Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Toggle IIS 7.5 Authentication "Anonymous Authentication" with Powershell 3.0?

I'd like to toggle the Anonymous Authentication (Enabled/Disabled) setting found in IIS Manager (7.5, Windows 7), Default Web Site / My Website - Authentication / Anonymous Authentication using Powershell.

I'm not looking for something that alters a web.config file, but does exactly what IIS Manager does.

I've tried Set-WebConfiguration and Set-WebConfigurationProperty but not gotten close.

Can anyone provide an example?

like image 571
AUSTX_RJL Avatar asked May 06 '26 04:05

AUSTX_RJL


1 Answers

Try the Set-WebConfigurationProperty cmdlet:

Set-WebConfigurationProperty -Filter system.webServer/security/authentication/anonymousAuthentication `
                              -PSPath MACHINE/WEBROOT/APPHOST `
                              -Location 'Default Web Site' `
                              -Name Enabled `
                              -Value $true
like image 126
Shay Levy Avatar answered May 09 '26 04:05

Shay Levy