0

i am runing powershell and from my powershell i want to connect to my Exchange powershell,
the diffrance betwwen the two files is in their target(right click =proproties),

"normal" powershell target ="%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe"

"exchange" powershell target = "C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\bin\Exchange.ps1'""

is there a way to connect to the exchange powershell by code??, my guess is to add those two extra line like in the target...

1 Answer 1

2

That command line will only work if the Exchange management tools are installed (it's going to try to load the Exchange management snapin.

Generally, it's easier to use implicit remoting in a script and import the functions from the remote shell into your current session:

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

Sign up to request clarification or add additional context in comments.

3 Comments

thanks, that looks very nice but unfortunately i am using Exchange 2007. :(
Then I think you'll need to install the management tools and load that snapin in your session.
The Exchange Management Tools that come with Exchange.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.