Winrm https basic auth with pywinrm
Jump to navigation
Jump to search
# Configure WinRM to use HTTPS and enable basic authentication Enable-PSRemoting -Force -SkipNetworkProfileCheck Set-Item WSMan:\localhost\Service\Auth\Basic -Value $true Set-Item WSMan:\localhost\Service\AllowUnencrypted -Value $false # Create a self-signed certificate (replace with a valid certificate in production) $cert = New-SelfSignedCertificate -DnsName "localhost" -CertStoreLocation cert:\LocalMachine\My $thumbprint = $cert.Thumbprint # Configure WinRM listener to use HTTPS and the created certificate New-Item -Path WSMan:\localhost\Listener -Transport HTTPS -Address * -CertificateThumbPrint $thumbprint -Force # Restart WinRM service to apply changes Restart-Service WinRM