How to disable basic authentication for windows server using PowerShell?



Basic authentication is the insecure authentication for the windows. To disable the basic authentication on the windows server using PowerShell,

PS C:\> Set-Item -Path "WSMan:\localhost\Service\Auth\Basic" -Value $false -Verbose

To disable the basic authentication on the remote windows servers using PowerShell, use the below command,

Invoke-Command -ComputerName TestMahchine1, TestMachine2 -
ScriptBlock {
   Set-Item -Path "WSMan:\localhost\Service\Auth\Basic" -Value
   $false -Verbose
}

Advertisements