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 but it is for the site, not the application level.
22 Answers
Give this a try, change the site name and application name:
Set-WebConfiguration "/ Web Site' and @id='1']/application[@path='/TestApp1']/VirtualDirectory[@path='/']" -Value @{userName='matt';password=123} This worked for me:
Set-ItemProperty IIS:\Sites\Staging -name physicalPath -value "C:\blah\Web"