Solved

Get-ActiveSyncStatistics Powershell?

Posted on 2013-11-19
4
1,016 Views
Last Modified: 2013-12-31
Using Exchange 2010 SP3;

I need to export a list, using powershell, showing who all has a mobile device partnership, last sync time, mobile device model, displayname and server database or server where the users mailbox is located (servername).

How can I get that?
0
Comment
Question by:GCTTechs
4 Comments
 

Author Comment

by:GCTTechs
Comment Utility
Thanks guys,

Florin_s, thats one that I was trying earlier but I was getting the following error:

get-activesync : 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:4 char:158
+ ... ame; $device = get-activesync devicestatistics -mailbox $_.identity; $device | f ...
+                    ~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (get-activesync:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Im also trying cmds like;
$Devices = $Mailboxes | %{Get-ActiveSyncDeviceStatistics -Mailbox $_.Identity} | `?{$_.DeviceType -like "iP*" -and $_.LastSuccessSync -gt (Get-Date).AddDays(-30)}

and get the following;
Cannot validate argument on parameter 'Mailbox'. The argument is null or empty. Supply an argument that is not null or empty and then try the command again.
0
 
LVL 53

Assisted Solution

by:Will Szymkowski
Will Szymkowski earned 250 total points
Comment Utility
Use the following below command to accomplish this...
$Mailbox = get-mailbox -ResultSize "unlimited"
Get-ActiveSyncDeviceStatistics -Mailbox $Mailbox | select DeviceType,DeviceUserAgent,LastSuccessSync,Identity

Open in new window


There are no member objects for Get-ActiveSyncDeviceStatistics which will allow you to get database where the mailbox resides on.

Will.
0
 
LVL 40

Accepted Solution

by:
Subsun earned 250 total points
Comment Utility
Try..
$UserList = Get-CASMailbox -ResultSize Unlimited -Filter {hasactivesyncdevicepartnership -eq $true -and -not displayname -like "CAS_{*}"} | Get-Mailbox

$(foreach ($User in $UserList) {
Try {
	Get-ActiveSyncDeviceStatistics -Mailbox $User.samaccountname -ea stop | %{
		$_ | Select @{N="DisplayName";e={$User.DisplayName}},@{N="Database";e={$User.Database}},@{N="ServerName";e={$User.ServerName}},LastSyncAttemptTime,LastSuccessSync,DeviceModel,DeviceType,DeviceID
	}
}
Catch {
Write-Host "Error for user $($User.samaccountname) - Error $($_.exception.message)"
}
}) | Export-Csv C:\Asyncreport.csv -NoTypeInformation

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now