happyexchange
asked on
Exchange 2007 Actice sync
Hi we have over 100 users who have ipads and iphones on our exchange. Is their a script i can use on Exchange 2007 to tell me what user has what device
Thank you
Thank you
You could use the following:
The Active Sync Dveice doesn't have a user field to disply but it does have an Identity which does show the user/device. If the Identity is truncated, you could use :
Reference
The Active Sync Dveice doesn't have a user field to disply but it does have an Identity which does show the user/device. If the Identity is truncated, you could use :
Get-Mailbox | ForEach {Get-ActiveSyncDeviceStatistics -Mailbox:$_.Identity} | fl DeviceFriendlyName, Devicetype, DeviceUserAgent, Identity
Reference
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This will give you what you want
$ActiveSyncDevices = @()
$Mailboxes = Get-CASMailbox -ResultSize:Unlimited | Where-Object {$_.HasActiveSyncDevicePartnership -eq $true}
ForEach ($Mailbox in $Mailboxes) {
$devs = Get-ActiveSyncDeviceStatistics -Mailbox $Mailbox.Identity –ErrorAction SilentlyContinue
$devs | Select DeviceFriendlyName, Devicetype, DeviceUserAgent | ForEach-Object {
$_ | Add-Member –MemberType NoteProperty -Name "MailboxIdentity" -value $Mailbox
$ActiveSyncDevices += $_ }
}
$ActiveSyncDevices | Export-csv c:\ActiveSyncDevices.csv
Download and install the log parsers
========================== ===
open logparser and after installing it in from start -- programfiles
run this command and Make sure you have IIS file
=================
logparser "SELECT cs-username AS UserID, cs(User-Agent) AS DeviceType, count (*) FROM c:\windows\system32\logfil es\w3svc1\ ex*.log WHERE cs-uri-stem LIKE '%Microsoft-Server-ActiveS ync%' AND cs-username IS NOT NULL GROUP BY UserID, DeviceType ORDER BY UserID" -rtp:-1 > C:\eas.csv
Note:
==========
Path in command : c:\windows\system32\logfil es\w3svc1\ ex*.log\
This is the path for the IIS logs. If you have iis log file on u r desktop then give that path
You will have the output in the CSV file in C drive (EAS.CSV)
==========================
open logparser and after installing it in from start -- programfiles
run this command and Make sure you have IIS file
=================
logparser "SELECT cs-username AS UserID, cs(User-Agent) AS DeviceType, count (*) FROM c:\windows\system32\logfil
Note:
==========
Path in command : c:\windows\system32\logfil
This is the path for the IIS logs. If you have iis log file on u r desktop then give that path
You will have the output in the CSV file in C drive (EAS.CSV)
You could also export the results by adding the "| Export-csv c:\ActiveSyncReport.csv"
$mbx = get-casmailbox -Filter {HasActivesyncDevicePartnership -eq $true -and -not DisplayName -like "CAS_{*"}; $mbx | foreach {$name = $_.name; $device = get-activesync devicestatistics -mailbox $_.identity; $device | foreach {write-host $mbx.name, $_.devicemodel, $_.devicephonenumber, $_.deviceid, $_.FirstSyncTime, $_.LastSuccessSync} } | Export-csv c:\ActiveSyncReport.csv
ASKER
Hi after running $mbx = get-casmailbox -Filter {HasActivesyncDevicePartne rship -eq $true -and -not DisplayName -like "CAS_{*"}; $mbx | foreach {$name = $_.name; $device = get-activesync devicestatistics -mailbox $_.identity; $device | foreach {write-host $mbx.name, $_.devicemodel, $_.devicephonenumber, $_.deviceid, $_.FirstSyncTime, $_.LastSuccessSync} } | Export-csv c:\ActiveSyncReport.csv
I get pls see below
The term 'get-activesync' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:169
+ $mbx = get-casmailbox -Filter {HasActivesyncDevicePartne rship -eq $true -and
-not DisplayName -like "CAS_{*"}; $mbx | foreach {$name = $_.name; $device = ge
t-activesync <<<< devicestatistics -mailbox $_.identity; $device | foreach {wr
ite-host $mbx.name, $_.devicemodel, $_.devicephonenumber, $_.deviceid, $_.First
SyncTime, $_.LastSuccessSync} } | Export-csv c:\ActiveSyncReport.csv
+ CategoryInfo : ObjectNotFound: (get-activesync:String) [], Comm
andNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I get pls see below
The term 'get-activesync' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:169
+ $mbx = get-casmailbox -Filter {HasActivesyncDevicePartne
-not DisplayName -like "CAS_{*"}; $mbx | foreach {$name = $_.name; $device = ge
t-activesync <<<< devicestatistics -mailbox $_.identity; $device | foreach {wr
ite-host $mbx.name, $_.devicemodel, $_.devicephonenumber, $_.deviceid, $_.First
SyncTime, $_.LastSuccessSync} } | Export-csv c:\ActiveSyncReport.csv
+ CategoryInfo : ObjectNotFound: (get-activesync:String) [], Comm
andNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Sorry try it like this:
$mbx = get-casmailbox -Filter {HasActivesyncDevicePartnership -eq $true -and -not DisplayName -like "CAS_{*"}; $mbx | foreach {$name = $_.name; $device = Get-ActiveSyncDeviceStatistics -mailbox $_.identity; $device | foreach {write-host $mbx.name, $_.devicemodel, $_.devicephonenumber, $_.deviceid, $_.FirstSyncTime, $_.LastSuccessSync} } | Export-csv c:\ActiveSyncReport.csv
did you try my script ?
$ActiveSyncDevices = @()
$Mailboxes = Get-CASMailbox -ResultSize:Unlimited | Where-Object {$_.HasActiveSyncDevicePartnership -eq $true}
ForEach ($Mailbox in $Mailboxes) {
$devs = Get-ActiveSyncDeviceStatistics -Mailbox $Mailbox.Identity –ErrorAction SilentlyContinue
$devs | Select DeviceFriendlyName, Devicetype, DeviceUserAgent | ForEach-Object {
$_ | Add-Member –MemberType NoteProperty -Name "MailboxIdentity" -value $Mailbox
$ActiveSyncDevices += $_ }
}
$ActiveSyncDevices | Export-csv c:\ActiveSyncDevices.csv
http://technet.microsoft.com/en-us/library/bb201675(EXCHG.80).aspx