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.

TIA.

I have seen you already asked this in StackOverflow … did you try to ask this in a dedicated IIS forum like https://forums.iis.net ?

Hi TIA,

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

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

Setting the credentials:

[pre]
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’
[/pre]

pwshliquori

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 forums.iis.net.

Thank you both!

Sam

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