Solved

Exchange activesync powershell exception

Posted on 2012-03-21
5
1,508 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
Comment Utility
Exchange is 14.2 Build 247.5
ALL IIS Application pools are set to .NET v2
0
 
LVL 19

Expert Comment

by:compdigit44
Comment Utility
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
Comment Utility
@ 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
Comment Utility
The issue was down to powergui trying to use .net4 to run the code!
0
 
LVL 37

Author Closing Comment

by:Neil Russell
Comment Utility
Was a known issue in the upgrade to powergui
0

Featured Post

Shouldn't all users have the same email signature?

You wouldn't let your users design their own business cards, would you? So, why do you let them design their own email signatures? Think of the damage they could be doing to your brand reputation! Choose the easy way to manage set up and add email signatures for all users.

Join & Write a Comment

Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
In this video we show how to create a User Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Mailb…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now