Solved

Get-ActiveSyncStatistics Powershell?

Posted on 2013-11-19
4
1,023 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
In this video we show how to create a Shared Mailbox 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 >> Sha…
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…

777 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