1

I have a number of applications under a Default Web Site in IIS7.

A number of the applications have to have their Physical Path Credentials set to a specific user rather than using application user.

Every few months the credentials for this user changes. I am trying to automate changing the credentials in IIS using powershell but cannot work out how to do so.

I have looked at this post http://blog.thejohnreynolds.com/post/10149304231/set-iis-physical-path-credentials-with-powershell but it is for the site, not the application level.

2
  • @Matt - It would be helpful to know what operating system the server is running, what version of Powershell you are using, and what you have attempted so far.
    – Ramhound
    May 9, 2013 at 12:40
  • Yeah, my bad. Shay has solved it but I'll try and do a better job of asking next time.
    – matt
    May 10, 2013 at 13:41

2 Answers 2

3

Give this a try, change the site name and application name:

Set-WebConfiguration "/system.applicationHost/sites/site[@name='Default Web Site' and @id='1']/application[@path='/TestApp1']/VirtualDirectory[@path='/']" -Value @{userName='matt';password=123}
0

This worked for me:

Set-ItemProperty IIS:\Sites\Staging -name physicalPath -value "C:\blah\Web"

You must log in to answer this question.

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