Using the Exchange Management Shell from Windows PowerShell

In my application I’ve to run some command to create a mailbox, so I found the commands to execute in Exchange Management Shell.

I’ve realyzed a class that permit to instantiate the PowerShell and I try to execute the script.
I received many errors because the script need Exchange Management Shell and not PowerShell.

What’s Exchange Management Shell do when it run?
Exchange 2007
It run PowerShell, then execute these commands

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
chdir "c:\program files\microsoft\exchange server\bin"
.\Exchange.ps1

more detail:
http://technet.microsoft.com/en-us/library/bb123778(v=exchg.80).aspx

Exchange 2010

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
. $env:ExchangeInstallPath\bin\RemoteExchange.ps1
Connect-ExchangeServer -auto

more detail:
http://www.mikepfeiffer.net/2010/02/managing-exchange-2010-with-remote-powershell/

Annunci

Informazioni su Andrea Regoli

Project Manager .Net Developer WPF WP7 Asp.Net c# javascript ajax SQL sharepoint
Questa voce è stata pubblicata in c#, Powershell. Contrassegna il permalink.

2 risposte a Using the Exchange Management Shell from Windows PowerShell

  1. Howdy, i read your blog occasionally and i own
    a similar one and i was just wondering if you get a lot of spam remarks?
    If so how do you stop it, any plugin or anything you can advise?

    I get so much lately it’s driving me insane so any support is very much appreciated.

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...