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
happyexchangeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
rajkr2020Commented:
0
 
Hendrik WieseInformation Security ManagerCommented:
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 :
Get-Mailbox | ForEach {Get-ActiveSyncDeviceStatistics -Mailbox:$_.Identity} | fl DeviceFriendlyName, Devicetype, DeviceUserAgent, Identity

Open in new window


Reference
0
 
Hendrik WieseInformation Security ManagerCommented:
You can also try this:

$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} }

Open in new window


From the following 2 reference sites: Site 1, Site 2
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
AkhaterCommented:
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

Open in new window

0
 
sumit_aroraCommented:
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\logfiles\w3svc1\ex*.log WHERE cs-uri-stem LIKE '%Microsoft-Server-ActiveSync%' 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\logfiles\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)
 
0
 
Hendrik WieseInformation Security ManagerCommented:
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

Open in new window

0
 
happyexchangeAuthor Commented:
Hi after running   $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

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 {HasActivesyncDevicePartnership -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
0
 
Hendrik WieseInformation Security ManagerCommented:
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

Open in new window

0
 
AkhaterCommented:
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

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.