Solved

MS exchange 2007 Active Sync. Powershell help.

Posted on 2013-06-06
2
469 Views
Last Modified: 2013-06-06
Hi again folks looking for additional help following my latest question.

In that question I wanted to know if I could default set active sync to disabled for my end users That aside for now here's my latest conundrum:

On this theme I want to do the following..
1.Identify all users with AS associated devices now
2.Identify of these who have not sync'd in the last 3 months
3.Output those that are active with association to file
4.Disable AS across all users
5.re-enable AS for users previously using it and meeting 3 month criteria using outputted file


Step 1. Get-Mailbox -ResultSize Unlimited | ForEach {Get-ActiveSyncDeviceStatistics -Mailbox:$_.Identity} | ft Identity, LastSuccessSync >c:\allowed.csv
Step 2. As above file is filtered in Excel by date and All those within 3 months are retained.
Step 3. Save above as csv file for use in step 5 All that will be in here is a single list with usernames.
Step 4. Set-CASMailbox -Identity "Joe Blo" -ActiveSyncEnabled $false
Step 5. Re-Enable Using allowed.csv

I need help building up in particular step 5.

Should I use an Import-csv and or a varible ($users = c:\allowed.csv)to call the csv list, maybe something else?

Help with the syntax of the commands would be helpful. I am not great with PS so would really appreciate spelling out the steps.

The csv file would be a single username column.
0
Comment
Question by:fletcher_l
2 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39225453
Try..
Import-Csv c:\allowed.csv | %{Set-CASMailbox -Identity $_.username -ActiveSyncEnabled $True}

Open in new window

Sample input csv file..
username
SubSun
SubSun1
SubSun2

Open in new window

0
 

Author Closing Comment

by:fletcher_l
ID: 39226187
Thanks Subsun that works great. I will look to tidy up later in order that it all becomes one neat job for me.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now