Solved

Exchange activesync powershell exception

Posted on 2012-03-21
5
1,582 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
[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
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 20

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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