How can I set up IIS website identity fields via WebAdministration cmdlets?

Looking for help on how to set the IIS website - NOT application pool - identity fields via the PowerShell WebAdministration module. I have many IIS servers (with many web sites on each) that need to have their passwords reset.


I have seen you already asked this in StackOverflow … did you try to ask this in a dedicated IIS forum like ?


You should be able to use the Get-WebConfigurationProperty and Set-WebConfigurationProperty to change the values. To see the existing configuration run:

Get-WebConfigurationProperty -PSPath “MACHINE/WEBROOT/APPHOST” -Filter “/system.applicationHost/sites/site[@name=‘site1’]/virtualDirectoryDefaults” -Name .

Setting the credentials:

Set-WebConfigurationProperty -PSPath “MACHINE/WEBROOT/APPHOST” -Filter “/system.applicationHost/sites/site[@name=‘site1’]/virtualDirectoryDefaults” -Name userName -Value ‘user’

Set-WebConfigurationProperty -PSPath “MACHINE/WEBROOT/APPHOST” -Filter “/system.applicationHost/sites/site[@name=‘site1’]/virtualDirectoryDefaults” -Name password -Value ‘Password’


Sorry for the delay … I thought the site would email me when responses to my question were received, but I haven’t received anything and only thought to check back just now.

@pwshliquori … thank you … will give it a try and report back.

@Olaf … I did receive an answer from Stack Overflow, but it only came a short while ago. If neither responses pan out, I’ll try

Thank you both!


P.S. I see a Notify me of follow-up replies via email below. I guess I missed that in my original post.