Solved

MS exchange 2007 Active Sync. Powershell help.

Posted on 2013-06-06
2
474 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This article explains how to install and use the NTBackup utility that comes with Windows Server.
To show how to create a transport rule 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 >> Rules tab.:  To cr…
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

807 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