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

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like