Managing Exchange 2010 SP1 ActiveSync from the command line
Microsoft’s recent disclosure that PowerShell will play a larger role in server management gives Exchange administrators another reason to familiarize themselves with the command line. Consider the growing number of mobile and remote users and you’ll see why it helps to master the commands necessary to manage ActiveSync.
The Exchange Management Shell commands discussed here are intended for use with Exchange 2010 SP1. Many of these commands exist in
When you register, you’ll also receive targeted alerts from my team of editorial writers and independent industry experts with the latest news, tips, and advice to help you do your job more efficiently and effectively. Our goal is to keep you informed on the hottest topics and biggest challenges faced by Exchange professionals today working with Exchange, Outlook and other related technologies.
Margie Semilof, Editorial Director
Premium Access
Register now for unlimited access to our premium content across our network of over 70 information Technology web sites.
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy
Dig Deeper
-
People who read this also read...
This was first published in November 2011
earlier versions of Exchange, but in certain cases, Microsoft has changed the syntax.
Creating a new ActiveSync mailbox policy via the Exchange Management Shell
Creating new ActiveSync mailbox policies from the command line may seem pointless to some. After all, many administrators create a single ActiveSync mailbox policy and it’s all they need. However, it’s important to realize there are many different mobiles devices out there and they all have different capabilities.
You can achieve a more granular level of control if you create a separate ActiveSync mailbox policy for each device type, and then base each policy around an individual device’s capabilities. For example, you can create one policy for Windows phones and a separate policy for iPhones.
To create a new ActiveSync mailbox policy, use the New-ActiveSyncMailboxPolicy command and append the –Name parameter. You must also assign the new policy a descriptive name. Your command will look similar to this:
New-ActiveSyncMailboxPolicy –Name ‘<policy name>’
After you create an ActiveSync mailbox policy, you must assign policy values. There are a number of parameters you can append to this command depending on how you’d like to configure the policy. Here are some commonly used parameters:
AllowNonProvisionableDevices
DevicePasswordEnabled
AlphanumericDevicePasswordRequired
MaxInactivityTimeDeviceLock
PasswordRecoveryEnabled
RequireDeviceEncryption
AttachmentsEnabled
AllowSimpleDevicePassword
Assign either a $True or $False value to all of these parameters. Other parameters require numerical values, while the Unlimited and $Null values can take the place of numbers. Here are some examples:
MinDevicePasswordLength $Null
DevicePasswordExpiration ‘Unlimited’
DevicePasswordHistory ‘0’
Below, observe that I’ve created an ActiveSync mailbox policy with all the aforementioned parameters:
New-ActiveSyncMailboxPolicy –Name ‘<policy name>’ -AllowNonProvisionableDevices $False –DevicePasswordEnabled $False –AlphanumericDevicePasswordRequired $False –MaxInactivityTimeDeviceLock $False –PasswordRecoveryEnabled $False –RequireDeviceEncryption $True –AttachmentsEnabled $True –AllowSimpleDevicePassword $True -MinDevicePasswordLength $Null -DevicePasswordExpiration ‘unlimited’ -DevicePasswordHistory ‘0’
Adding a user to an ActiveSync mailbox policy via the Exchange Management Shell
Just as you can create an ActiveSync mailbox policy from the command line, you can also add users to the policy via an Exchange Management Shell (EMS) command:
Set-CASMailbox <user name> -ActiveSyncMailboxPolicy(Get-ActiveSyncMailboxPolicy “<policy name>”).Identity
For example, if you want to add a user named JaneD to an ActiveSync mailbox policy named WindowsPhone, you can use the following command:
Set-CASMailbox JaneD –ActiveSyncMailboxPolicy (Get-ActiveSyncMailboxPolicy “WindowsPhone”).Identity
Retrieve mobile device usage statistics via the Exchange Management Shell
You can use the Get-ActiveSyncDeviceStatistics command in two ways. For one, you can use it to retrieve ActiveSync usage statistics for an individual user. To do so, use the following command:
Get-ActiveSyncDeviceStatistics –Identity <user name>
You can also use this command to create a report detailing the end users in your organization that have devices linked to their Exchange mailboxes. You can then display usage statistics for those devices. This command’s syntax is tricky because you must apply a filter to prevent client access server-related statistics from displaying alongside the mobile device usage statistics. To do so, use the following command:
Get-CASMailbox –Filter {HasActiveSyncDevicePartnership –eq $true and –not DisplayName –Like “CAS_(*”} | Get-Mailbox | ForEach { Get-ActiveSyncDeviceStatistics –Mailbox $_}
View which mobile devices are in use via the Exchange Management Shell
To find out how many devices a user has, use the Get-ActiveSyncDevice command. The reasons to use this command are similar to those of the Get-ActiveSyncDeviceStatistics command. For example, to view the devices registered to an individual user, use the following command:
Get-ActiveSyncDevice –Identity <user name>
To view all devices for all users in your Exchange organization, use the following command:
Get-CASMailbox –Filter {HasActiveSyncDevicePartnership –eq $true and –not DisplayName –Like “CAS_(*”} | Get-Mailbox | ForEach { Get-ActiveSyncDevice –Mailbox $_}
ABOUT THE AUTHOR:
Brien Posey is an eight-time Microsoft MVP with two decades of IT experience. Before becoming a freelance technical writer, Brien worked as a CIO for a national chain of hospitals and healthcare facilities. He has also served as a network administrator for some of the nation’s largest insurance companies and for the Department of Defense at Fort Knox.
Disclaimer:
Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.