Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Get-ActiveSyncStatistics Powershell?

Posted on 2013-11-19
4
Medium Priority
?
1,065 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 1000 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 1000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

719 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