muonlab » 2011 » June

random .NET and web development musings

First, download msdeploy from here: http://www.iis.net/download/WebDeploy

Then install it like this:

msiexec /i <msi_filename> /passive ADDLOCAL=ALL LISTENURL=https://+:443/MsDeployAgentService/

(you can change the port and listen path if you like, if you do, be sure to use your different port in the next step below)

Then, get yourself an SSL or create a self signed one, in install it against MSDeploy like so:

Server 2003:

httpcfg set ssl -i 0.0.0.0:443 -h <cert hash> -g {00000000-0000-0000-0000-000000000000}

Server 2008:

netsh.exe http add sslcert ipport=0.0.0.0:443 appid={00000000-0000-0000-0000-000000000000} certhash=<cert hash>

To find your cert hash, either through IIS or the Certificates MMC snap-in view your cert, copy the thumbprint into notepad and remove the spaces.

Then, to connect to MSDeploy remotely, use the following command:

msdeploy.exe -verb:sync -source:dirPath='<Some Local Path>' -dest:dirPath='<Some Remote Path>',computername=<Remote server name>,userName=<Remote User>,password=<Password> -verbose

Add the -allowUntrusted switch if you are using a self signed SSL.