0

I'm trying to connect the 'Connect As' username for the physical path on our IIS 7.5 web site, that's found in the Sites -> Default Web Site -> Basic Settings -> Connect As UI windows. I need to do it through either the powershell command line, or during an MSDeploy command line application deployment. Currently it's populated with the username and password from a different environment with a different domain, so the user doesn't work, so it needs to be changed. Also we use the same IIS settings across all most of our environments so it's much more convenient to roll 1 zip package and change the username on deployment rather than roll 1 zip package for each environment, or change it manually every time we deploy.

1 Answer 1

3

Make sure you have the IIS PowerShell module install, then use:

Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter `
 "system.applicationHost/sites/site[@name='Default Web Site']/application[@path='/']/virtualDirectory[@path='/']" `
 -name "userName" -value "peter"

Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter `
 "system.applicationHost/sites/site[@name='Default Web Site']/application[@path='/']/virtualDirectory[@path='/']" `
 -name "password" -value "mysuperpassword"

These are two lines, I just formatted them for display here.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .