We help IT Professionals succeed at work.

Generate report of devices by user for Exchange ActiveSync on Exchange 2003 SP2

rustyrpage asked
Last Modified: 2012-05-11
Does anyone know of a third party tool or something that can help me to run a report of all devices by user that are connected to my Exchange ActiveSync server?  I can get this information through MobileAdmin, however, it requires that I go into each user account.  Having this information would be very helpful as I need to ensure that no one is using un-approved devices.

Please advise.
Watch Question

save as .ps1 and run in powershell
./ sync.ps1 > c:\activesyncedevices.txt
# NAME: Get-ActiveSyncDeviceInfo.ps1 
# AUTHOR: Jan Egil Ring 
# EMAIL: jan.egil.ring@powershell.no 
# COMMENT: Script to retrieve all ActiveSync-devices registered within the Exchange-organization. 
#          A conversion-table for Apple-devices are provided, you might remove this if you want to 
#          retrieve the real DeviceUserAgent-names for those devices. 
#          The script outputs objects to make it easier working with the results, i.e. to export 
#          the output using Export-Csv, sort them, group them and so on. 
#          Works with both Exchange 2007 and Exchange 2010. Since a new cmdlet, Get-ActiveSyncDevice, 
#          exist in Exchange 2010, you might want to use that when working against Exchange 2010. 
#          For more information, see the following blog-post: 
#          http://blog.powershell.no/2010/09/26/getting-an-overview-of-all-activesync-devices-in-the-exchange-organization 
# You have a royalty-free right to use, modify, reproduce, and 
# distribute this script file in any way you find useful, provided that 
# you agree that the creator, owner above has no warranty, obligations, 
# or liability for such use. 
# 1.0 26.09.2010 - Initial release 
#Retrieve all mailboxes in the Exchange organization 
$mailboxes = Get-Mailbox -ResultSize unlimited 
#Loop through each mailbox 
foreach ($mailbox in $mailboxes) { 
$devices = Get-ActiveSyncDeviceStatistics -Mailbox $mailbox.samaccountname | Select-Object DeviceType,DevicePolicyApplied,LastSuccessSync,DeviceUserAgent 
#If the current mailbox has an ActiveSync device associated, loop through each device 
if ($devices) { 
foreach ($device in $devices){ 
#Conversion table for Apple-devices 
switch ($device.DeviceUserAgent) { 
"Apple-iPhone/701.341" {$DeviceUserAgent = "iPhone"} 
"Apple-iPhone/703.144" {$DeviceUserAgent = "iPhone"} 
"Apple-iPad/702.367" {$DeviceUserAgent = "iPad"} 
"Apple-iPod2C1/801.293" {$DeviceUserAgent = "iPod"} 
"Apple-iPod3C1/801.293" {$DeviceUserAgent = "iPod"} 
"Apple-iPhone1C2/801.293" {$DeviceUserAgent = "iPhone 3G"} 
"Apple-iPhone2C1/801.293" {$DeviceUserAgent = "iPhone 3GS"} 
"Apple-iPhone3C1/801.293" {$DeviceUserAgent = "iPhone 4"} 
"Apple-iPhone/508.11" {$DeviceUserAgent = "iPhone"} 
"Apple-iPhone/701.400" {$DeviceUserAgent = "iPhone"} 
"Apple-iPhone/704.11" {$DeviceUserAgent = "iPhone"} 
"Apple-iPhone/705.18" {$DeviceUserAgent = "iPhone"} 
"Apple-iPod2C1/801.306" {$DeviceUserAgent = "iPod"} 
"Apple-iPod3C1/801.306" {$DeviceUserAgent = "iPod"} 
"Apple-iPhone1C2/801.306" {$DeviceUserAgent = "iPhone 3G"} 
"Apple-iPhone2C1/801.306" {$DeviceUserAgent = "iPhone 3GS"} 
"Apple-iPhone2C1/801.400" {$DeviceUserAgent = "iPhone 3GS"} 
"Apple-iPhone3C1/801.306" {$DeviceUserAgent = "iPhone 4"} 
default {$DeviceUserAgent = $device.DeviceUserAgent} 
#Create a new object and add custom note properties for each device 
$deviceobj = New-Object -TypeName psobject 
$deviceobj | Add-Member -Name User -Value $mailbox.samaccountname -MemberType NoteProperty 
#$deviceobj | Add-Member -Name DeviceType -Value $device.DeviceType -MemberType NoteProperty 
#$deviceobj | Add-Member -Name DeviceUserAgent -Value $DeviceUserAgent -MemberType NoteProperty 
#$deviceobj | Add-Member -Name DevicePolicyApplied -Value $device.DevicePolicyApplied -MemberType NoteProperty 
#$deviceobj | Add-Member -Name LastSuccessSync -Value #($device.LastSuccessSync).ToShortDateString() -MemberType NoteProperty 
#Write the custom object to the pipeline 
Write-Output -InputObject $deviceobj 

Open in new window


I am new to Powershell - what do I install & how do I run that?

http://support.microsoft.com/kb/968929 to install PS V 2.0
copy the code i gave you and save it as sync.ps1 do the desktop of the exchange server
create a shortcut on the desktop for the PS cmdlet
start PS
copy and paste ./ sync.ps1 > c:\activesyncedevices.txt
hit enter thats it :)


Do this on the front-end or back-end?


Also, I don't know what you mean by "create a shortcut on the desktop for the PS cmdlet"

Crap, this only works for 2007 and 2k10. We will have to use WMI give me an hour or so
This one is on us!
(Get your first solution completely free - no credit card required)

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.