Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Get-ActiveSyncStatistics Powershell?

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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

Want to know how to use Exchange Server Eseutil command? Go through this article as it gives you the know-how.
Eseutil Hard Recovery is part of exchange tool and ensures Exchange mailbox data recovery when mailbox gets corrupt due to some problem on Exchange server.
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
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…

926 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