GaryB Posted July 20, 2010 Share Posted July 20, 2010 I am trying to run a Microsoft Exchange server command with PowerShell and if I open Power Shell and run the command manually it runs fine and when I paste the command in a dos batch file it runs great, but when I run the command below it appears to try and open the Power Shell in a 32 bit window based off the error I get. I posted the error below the command. Any suggestions would be greatly appreciated. Thanks, Gary RunWait(@ComSpec & " /c " & 'PowerShell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\Bin\ExShell.Psc1" -Command ". ''c:\test.ps1''"', "", @SW_MAXIMIZE) ; C:\Exchange Scripts>PowerShell.exe -PSConsoleFile "C:\Program Files\Microsoft\Server\Bin\ExShell.Psc1" -Command ". 'C:\Exchange Scripts\remove_forward.ps1' WARNING: The following errors occurred when loading console C:\Program Files\Microsoft\Exchange Server\Bin\ExShell.Psc1: Cannot load Windows PowerShell snap-in Microsoft.Exchange.Management.PowerShell.Admin because of the following error: No Windows PowerShell Snap-ins are available for version 1. Command ". 'C:\Exchange Scripts\remove_forward.ps1'" could not be executed Link to comment Share on other sites More sharing options...
Bert Posted July 20, 2010 Share Posted July 20, 2010 http://social.technet.microsoft.com/Forums/en-US/exchangesvradmin/thread/739de516-1207-440d-8fcb-af86cb113c46 The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now