Solved

Get-ActiveSyncStatistics Powershell?

Posted on 2013-11-19
4
1,039 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Author Comment

by:GCTTechs
ID: 39662256
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
ID: 39663855
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
ID: 39665587
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Read this checklist to learn more about the 15 things you should never include in an email signature.
Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
To show how to generate a certificate request 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 >> Certificates…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

740 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