Solved

MS exchange 2007 Active Sync. Powershell help.

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Final Exchange 2010 to 2016 steps query 9 48
Exchange 2010 Room mailboxes 5 34
add image on html mail 6 18
exchange, SPF 21 16
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we show how to create a Contact 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 Recipients >> Contact ta…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

770 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