Running a command in Exchange Management Shell from Winexe
The following works nicely when run from a dos prompt locally... 

C:\Users\s-idauto>PowerShell.exe -command ". 'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; New-MailboxExportRequest -Mailbox "my_testuser" -FilePath "\\deonetapp01\userarchive$\my_testuser.pst"

but I want a version that I can run remotely from winexe, so I tried escaping quotes like 

/usr/bin/winexe -U dallasray/administrator%somePassword //10.0.1.111 "PowerShell.exe -command \". \'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1\'; Connect-ExchangeServer -auto;"


but that yields an error of "ERROR: Cannot open control pipe - NT_STATUS_INVALID_PARAMETER"
April 29th, 2015 2:51pm

Hi

have you tried loading the exchange snap-in first?

Free Windows Admin Tool Kit Click here and download it now
May 5th, 2015 12:57pm

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

Other recent topics Other recent topics