Solved

Exchange activesync powershell exception

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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

688 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