[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

MS exchange 2007 Active Sync. Powershell help.

Posted on 2013-06-06
2
Medium Priority
?
494 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 2000 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

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

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

In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
In this video we show how to create an email address policy 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 Mail Flow…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
Suggested Courses

872 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