We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

IIS does not recognize Windows authentication via PowerShelllRSS

1 reply

Last post May 24, 2021 02:11 AM by samwu

  • IIS does not recognize Windows authentication via PowerShelll

    May 23, 2021 09:08 AM|anwarjutt|LINK

    I am trying to update the status of Windows authentication in IIS, I tried to execute with the command:

    "Set-WebConfigurationProperty -Filter "/system.webServer/security/authentication/windowsAuthentication" -Name Enabled -Value True -PSPath "IIS:\Sites\$SiteName\$AppName"

    but I get the error:

    WARNING Property Enable is not found on /system.webServer/security/authentication/windowsAuthentication

    Microsoft Authentication works and is installed on the machine I am working on, I would love if someone got a solution

  • Re: IIS does not recognize Windows authentication via PowerShelll

    May 24, 2021 02:11 AM|samwu|LINK

    Hi anwarjutt,

    anwarjutt

    but I get the error:

    WARNING Property Enable is not found on /system.webServer/security/authentication/windowsAuthentication

    You can try enable windows authentication and disable anonymous authentication and try again.

    $iisSiteName = "Default Web Site"
    $iisAppName = "MyApp"
    
    Write-Host Disable anonymous authentication
    Set-WebConfigurationProperty -Filter '/system.webServer/security/authentication/anonymousAuthentication' -Name 'enabled' -Value 'false' -PSPath 'IIS:\' -Location "$iisSiteName/$iisAppName"
    
    Write-Host Enable windows authentication
    Set-WebConfigurationProperty -Filter '/system.webServer/security/authentication/windowsAuthentication' -Name 'enabled' -Value 'true' -PSPath 'IIS:\' -Location "$iisSiteName/$iisAppName"

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >