Avatar of rustyrpage
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.
Exchange

Avatar of undefined
Last Comment
5g6tdcv4

8/22/2022 - Mon
5g6tdcv4

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. 
# 
# VERSION HISTORY: 
# 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

rustyrpage

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

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 :)
Your help has saved me hundreds of hours of internet surfing.
fblack61
rustyrpage

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

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

Crap, this only works for 2007 and 2k10. We will have to use WMI give me an hour or so
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
5g6tdcv4

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.