[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Exchange 2007 Actice sync

Posted on 2011-10-24
9
Medium Priority
?
463 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:happyexchange
9 Comments
 
LVL 5

Expert Comment

by:rajkr2020
ID: 37017178
0
 
LVL 21

Expert Comment

by:Hendrik Wiese
ID: 37017224
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
 
LVL 21

Accepted Solution

by:
Hendrik Wiese earned 2000 total points
ID: 37017236
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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 49

Expert Comment

by:Akhater
ID: 37017241
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
 
LVL 6

Expert Comment

by:sumit_arora
ID: 37017248
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
 
LVL 21

Expert Comment

by:Hendrik Wiese
ID: 37017249
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
 

Author Comment

by:happyexchange
ID: 37017292
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
 
LVL 21

Expert Comment

by:Hendrik Wiese
ID: 37017302
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
 
LVL 49

Expert Comment

by:Akhater
ID: 37017309
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Steps to fix error: “Couldn’t mount the database that you specified. Specified database: HU-DB; Error code: An Active Manager operation fail”
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses
Course of the Month19 days, 22 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question