Set Physical Path Credentials in Iis7 Using Powershell

Set Physical Path Credentials in Iis7 Using Powershell

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.

2

2 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"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.