Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell 5.1 snap in registration errors

To preface this, this script i made that involves creating 2007 MS Exchange mailboxes had worked a week or two ago, and suddenly gave me an error (below) from this:

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin

error given:

Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 5.

I have been all over and can't find anything to help. the command get-PsSnapins -registered doesn't give me anything. I did a clean windows 7 install, did all the windows updates, everything i can think of. I've tried running it without that snap-in but powershell doesn't recognize it as a cmdlet. All out of ideas and options

I am an admin on the network, machine, and running powershell as an admin. Execution policy is set to unrestricted

like image 376
toupin Avatar asked Nov 30 '25 19:11

toupin


1 Answers

As an FYI, PowerShell 5.0+ is incompatible with Microsoft Exchange 2013: Product Compatibility Status

You should use PSRemoting to connect to the Exchange server, and run from there Directly Loading Exchange 2010 or 2013 SnapIn Is Not Supported:

$ExSession =  New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri 'http://exServer01.contoso.com/PowerShell/' -Authentication Kerberos
Import-PSSession ($ExSession) -AllowClobber

If this was working for you in the past, make sure that you are launching the 32 bit Windows PowerShell (x86) version of PowerShell, as the Exchange Snapin is not 64 bit.

like image 102
HAL9256 Avatar answered Dec 02 '25 19:12

HAL9256



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!