Quantcast
Channel: Exchange Server 2010 forum
Viewing all articles
Browse latest Browse all 8820

Get-ActiveSyncDeviceStatistics. Exchange 2010

$
0
0

Hi  All, 

Has anyone had issues with Get-ActiveSyncDeviceStatistics?
I've been having an issue running a script that I was wondering if anyone had some advice. 

I'm trying to run a script that will gather all exchange users w/ an active sync device, but I'm getting an error with the get-activesyncdevicestatistics portion. 

If I run get-activesyncdevicestatistics in the exchange shell as a test, I get results as normal.  But when i run it through powergui or if I run the entire script through the shell, I get errors...

Here is my code: 

$file = "c:\activesynctest.csv"
$devices = @()
$mailboxes = Get-CASMailbox -ResultSize:Unlimited | Where-Object {$_.HasActiveSyncDevicePartnership -eq $true} 
foreach ($m in $mailboxes) 
{    
$devices += Get-ActiveSyncDeviceStatistics -Mailbox $m.identity
}
$devices | Where-Object {$_} | Export-Csv $file

The Error I receive: 

Get-ActiveSyncDeviceStatistics : The type initializer for 'Microsoft.Exchange.Data.Storage.SyncStateStorage' threw an 
exception.
At line:1 char:1
+ Get-ActiveSyncDeviceStatistics -Mailbox $m.identity
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-ActiveSyncDeviceStatistics], TypeInitializationException
    + FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.Exchange.Management.Tasks.GetMobileDeviceStati 
   stics

Like I said, the command for a single user runs fine through the shell, but I get the error through powergui or when I attempt to run the entire script through the shell. 

As a work around, I have been running a different script that simply uses Get-ActiveSyncDevice and pulls as many attributes as possible, but since I don't have the option to use the "HasActiveSyncDevicePartnerShip - $true", I get a lot of old devices in the results. 

Anyway, If anyone has any input I would appreciate it. 
Thanks!


Viewing all articles
Browse latest Browse all 8820

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>