Solved

Exchange activesync powershell exception

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
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…
In this video we show how to create a Distribution Group 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 >>…
In this video we show how to create an email address policy 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 Mail Flow…

910 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

22 Experts available now in Live!

Get 1:1 Help Now