Loading the Exchange Management Shell in Powershell

Hi there,

I want to write a script that executes certain Powershell-commands, one of it being "New-GlobalAddressList". So I found out I need to run

. "C:\Program Files\Microsoft\Exchange Server\V15\Bin\RemoteExchange.ps1" Connect-ExchangeServer -auto"

Okay, that worked, but I still cannot use "New-GlobalAddressList" (CommandNotFoundException)

What am I missing?

July 10th, 2013 7:12pm

Can you run the other commands related Address Book like

New-AddressList
New-OfflineAddressBook

If not, I would try to connect to a specific CAS server and then try.

Free Windows Admin Tool Kit Click here and download it now
July 11th, 2013 9:52am

No, I can't. And I am executing this command from the CAS. I don't even find any documentation about that.
July 12th, 2013 1:58am

Can you try this.

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto"

Free Windows Admin Tool Kit Click here and download it now
July 12th, 2013 2:02am

I found the solution. I need to execute ADD-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn. I thought that would be obsolete with the use of the RemoteExchange script.

July 12th, 2013 2:20am

Thanks for sharing the solution
Free Windows Admin Tool Kit Click here and download it now
July 12th, 2013 5:19am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics