• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 775
  • Last Modified:

Need a command to find out how many activesync users we have

I am trying to find out exactly how many of our users that ActiveSync enabled on their account. I need this for an audit. I can't believe there is no powershell command to tell me this. I looked and could not find anything. Can someone help out here? Just want to export out all users that have this feature enabled.
0
osiexchange
Asked:
osiexchange
  • 4
  • 3
1 Solution
 
Alan HardistyCommented:
What version of Exchange are you using?

If Exchange 2003 - there is no easy way.

If Exchange 2007 / 2010, please use the following:

Get-Mailbox | ForEach {Get-ActiveSyncDeviceStatistics -Mailbox:$_.Identity} | ft DeviceFriendlyName, Devicetype, DeviceUserAgent
0
 
osiexchangeAuthor Commented:
Sorry. I forgot to mention that. We are using 2007. I will give it a try.
0
 
Alan HardistyCommented:
You can play with the variables at the end to get different information out like the username etc.  Shout if you need guidance.
0
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
osiexchangeAuthor Commented:
How would I get the user associated with the device? Is there any way to look at this particular feature to see whether it is enabled or disabled? The command you gave me looks at the device properties with the assumption that AS is enabled, but this is not always the case. When you disable this feature for a user, this device stays in the properties.
0
 
Alan HardistyCommented:
Try the following:

Get-CASMailbox -Filter {hasactivesyncdevicepartnership - eq $true} | ForEach {Get-ActiveSyncDeviceStatistics -Mailbox:$_.Identity} | ft Identity, Devicetype

This will show you the device with a current partnership and the user associated with that partnership (active or not).

Get-CASMailbox -Filter {hasactivesyncdevicepartnership - eq $true} | ForEach {Get-ActiveSyncDeviceStatistics -Mailbox:$_.Identity} | ft Identity, Devicetype, LastSuccessSync

The above will show you the last time the device was synced with the server, so you can weed out ones that have not been in touch for a long time.

If you can't see the full username due to the size of the columns, change the line to:

Get-CASMailbox -Filter {hasactivesyncdevicepartnership - eq $true} | ForEach {Get-ActiveSyncDeviceStatistics -Mailbox:$_.Identity} | fl Identity, Devicetype, LastSuccessSync
0
 
osiexchangeAuthor Commented:
Actually, the command get-CASMailbox all by itself worked great. That gave me what I needed.
0
 
Alan HardistyCommented:
Okay - glad you have what you need.

Do you need anything else?  If not - don't forget to close down the question.

Alan
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now