Solved

Exchange activesync powershell exception

Posted on 2012-03-21
5
1,546 Views
Last Modified: 2012-11-09
When trying to execute the following commandlet:

Get-ActiveSyncDeviceStatistics -Mailbox "xxxx.xxxxxx"
I get the followin error generated

WARNING: An unexpected error has occurred and a Watson dump is being generated: The type initializer for 'Microsoft.Exchange.Data.Storage.SyncStateStorage' threw an exception.
Get-ActiveSyncDeviceStatistics : The type initializer for 'Microsoft.Exchange.Data.Storage.
SyncStateStorage' threw an exception.
At line:1 char:31
+ Get-ActiveSyncDeviceStatistics <<<<  -Mailbox "xxxx.xxxxxx"
    + CategoryInfo          : NotSpecified: (:) [Get-ActiveSyncDeviceStatistics], TypeInit
   ializationException
    + FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.Exchange.Manage
   ment.Tasks.GetMobileDeviceStatistics


And the following in the eventlog.

+ System

  - Provider

   [ Name]  MSExchange CmdletLogs
 
  - EventID 6

   [ Qualifiers]  49152
 
   Level 2
 
   Task 1
 
   Keywords 0x80000000000000
 
  - TimeCreated

   [ SystemTime]  2012-03-21T11:00:38.000000000Z
 
   EventRecordID 84513
 
   Channel MSExchange Management
 
   Computer SHIS-MAIL1.xshis.nhs.uk
 
   Security
 

- EventData

   Get-ActiveSyncDeviceStatistics
   {Mailbox=xxxx.xxxx, Debug=True}
   MyDomain.com/Users/MyAdmin
   
   
   PowerGUIScriptEditorHost-Local
   9328
   
   8
   00:00:09.4222368
   View Entire Forest: 'True',  
   System.TypeInitializationException: The type initializer for 'Microsoft.Exchange.Data.Storage.SyncStateStorage' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Microsoft.Exchange.Data.Storage.NativeStorePropertyDefinitionDictionary' threw an exception. ---> System.NotSupportedException: Not supported field(MailEnabled) type(Microsoft.Exchange.Data.Storage.PropertyTagPropertyDefinition). at Microsoft.Exchange.Data.Storage.NativeStorePropertyDefinitionDictionary.PropertyDefinitionSets.BuildWellKnownSets() at Microsoft.Exchange.Data.Storage.NativeStorePropertyDefinitionDictionary..cctor() --- End of inner exception stack trace --- at Microsoft.Exchange.Data.Storage.GuidNamePropertyDefinition.TryFindEquivalentDefinition(GuidNameKey key, Boolean isCustom, PropType type, TypeCheckingFlag typeCheckingFlag, GuidNamePropertyDefinition& definition, Boolean& createNewDefinition) at Microsoft.Exchange.Data.Storage.GuidNamePropertyDefinition.InternalCreate(String displayName, Type propertyType, PropType mapiPropType, Guid propertyGuid, String propertyName, PropertyFlags flags, TypeCheckingFlag typeCheckingFlag, Boolean isCustom, PropertyDefinitionConstraint[] constraints) at Microsoft.Exchange.Data.Storage.GuidNamePropertyDefinition.CreateCustom(String displayName, Type propertyType, Guid propertyGuid, String propertyName, PropertyFlags flags, PropertyDefinitionConstraint[] constraints) at Microsoft.Exchange.Data.Storage.GuidNamePropertyDefinition.CreateCustom(String displayName, Type propertyType, Guid propertyGuid, String propertyName, PropertyFlags flags) at Microsoft.Exchange.Data.Storage.SyncStateStorage..cctor() --- End of inner exception stack trace --- at Microsoft.Exchange.Data.Storage.SyncStateStorage.GetSyncFolderRoot(MailboxSession mailboxSession) at Microsoft.Exchange.Data.Storage.SyncStateStorage.SyncStateStorageEnumerator..ctor(MailboxSession mailboxSession) at Microsoft.Exchange.AirSync.DeviceInfo.GetAllDeviceInfo(MailboxSession mailboxSession) at Microsoft.Exchange.Management.Tasks.GetMobileDeviceStatistics.InternalProcessRecord() at Microsoft.Exchange.Configuration.Tasks.Task.ProcessRecord() at System.Management.Automation.CommandProcessor.ProcessRecord()
   0
   System.TypeInitializationException: The type initializer for 'Microsoft.Exchange.Data.Storage.NativeStorePropertyDefinitionDictionary' threw an exception. ---> System.NotSupportedException: Not supported field(MailEnabled) type(Microsoft.Exchange.Data.Storage.PropertyTagPropertyDefinition). at Microsoft.Exchange.Data.Storage.NativeStorePropertyDefinitionDictionary.PropertyDefinitionSets.BuildWellKnownSets() at Microsoft.Exchange.Data.Storage.NativeStorePropertyDefinitionDictionary..cctor() --- End of inner exception stack trace --- at Microsoft.Exchange.Data.Storage.GuidNamePropertyDefinition.TryFindEquivalentDefinition(GuidNameKey key, Boolean isCustom, PropType type, TypeCheckingFlag typeCheckingFlag, GuidNamePropertyDefinition& definition, Boolean& createNewDefinition) at Microsoft.Exchange.Data.Storage.GuidNamePropertyDefinition.InternalCreate(String displayName, Type propertyType, PropType mapiPropType, Guid propertyGuid, String propertyName, PropertyFlags flags, TypeCheckingFlag typeCheckingFlag, Boolean isCustom, PropertyDefinitionConstraint[] constraints) at Microsoft.Exchange.Data.Storage.GuidNamePropertyDefinition.CreateCustom(String displayName, Type propertyType, Guid propertyGuid, String propertyName, PropertyFlags flags, PropertyDefinitionConstraint[] constraints) at Microsoft.Exchange.Data.Storage.GuidNamePropertyDefinition.CreateCustom(String displayName, Type propertyType, Guid propertyGuid, String propertyName, PropertyFlags flags) at Microsoft.Exchange.Data.Storage.SyncStateStorage..cctor()


Any thoughts?

Neil
0
Comment
Question by:Neil Russell
  • 4
5 Comments
 
LVL 37

Author Comment

by:Neil Russell
ID: 37746900
Exchange is 14.2 Build 247.5
ALL IIS Application pools are set to .NET v2
0
 
LVL 19

Expert Comment

by:compdigit44
ID: 37768994
Try the following syntax listed in the article: http://social.technet.microsoft.com/Forums/eu/exchange2010/thread/5c700568-5646-483b-8df3-c170edf5fda2

Get-ActiveSyncDevice |ft DeviceModel, DeviceType, UserDisplayName -autosize
0
 
LVL 37

Author Comment

by:Neil Russell
ID: 37770045
@ compdigit44

I know how to use the commands! I have this running on 4 different exchange infrastructures. The command syntax is perfectly valid thank you.
0
 
LVL 37

Accepted Solution

by:
Neil Russell earned 0 total points
ID: 38566727
The issue was down to powergui trying to use .net4 to run the code!
0
 
LVL 37

Author Closing Comment

by:Neil Russell
ID: 38583247
Was a known issue in the upgrade to powergui
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

803 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