Error adding exchange 2010 snapin

I'm trying to add the Exchange 2010 snapin in a powershell script but get the following error:

Add-PSSnapIn : Cannot load Windows PowerShell snap-in
Microsoft.Exchange.Management.PowerShell.E2010 because of the following error:
The type initializer for 'Microsoft.Exchange.Data.Directory.Globals' threw an exception.
At C:\temp\addexchusers.PS1:253 char:7
+       Add-PSSnapIn Microsoft.Exchange.Management.PowerShell.E2010
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Excha...owerShell.E2010:String) [Add-PSSnapin], PSSnapInException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

Can anyone help fix this please?


Leave a Comment