When I use the following Powerhell script the anonymous authentification for the my website in IIS is not changing from 'Enabled' to 'Disabled'. Could anybody help please:-
Import-Module WebAdministration
Set-WebConfigurationProperty -filter /system.webServer/security/authentication/anonymousAuthentication -name enabled -value false -PSPath IIS:\Sites\myWebsite -Force
I also tried this:-
Set-WebConfigurationProperty -filter /system.webServer/security/authentication/anonymousAuthentication -name disable -value true -PSPath IIS:\Sites\myWebsite -Force
I have also tried:-
Set-WebConfigurationProperty -filter '/system.webServer/security/authentication/anonymousAuthentication' -name enabled -value false -PSPath IIS:\Sites\myWebsite -Force
I have also tried this but stil does not work:-
Set-WebConfigurationProperty -Filter /system.webServer/security/authentication/anonymousAuthentication -name Enabled -value False -PSPath 'IIS:\' -Location "Sites\myWebsite"
I am not getting any errors. It appears that the script runs successfully.
Also, does anybody know how I would set forms Authentication to disabled too?
So looks like I am able to set the authentication to 'Enabled' if I do this:-
Set-WebConfigurationProperty -Filter /system.webServer/security/authentication/anonymousAuthentication -name Enabled -value true -Location "IIS:\Sites\myWebsite"
But I can not set the Authentication to 'Disabled' if I do this:-
Set-WebConfigurationProperty -Filter /system.webServer/security/authentication/anonymousAuthentication -name Enabled -value false -Location "IIS:\Sites\myWebsite"