Link to home
Create AccountLog in
Avatar of rustyrpage

asked on

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

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.
Avatar of 5g6tdcv4
Flag of United States of America image

save as .ps1 and run in powershell
./ sync.ps1 > c:\activesyncedevices.txt
# NAME: Get-ActiveSyncDeviceInfo.ps1 
# AUTHOR: Jan Egil Ring 
# 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: 
# 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

Avatar of rustyrpage


I am new to Powershell - what do I install & how do I run that? 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
Avatar of 5g6tdcv4
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account