Update Servers/Automation/Ansible/Enable WinRM on Windows Devices.md

This commit is contained in:
2025-03-13 18:09:09 -06:00
parent 27e11c122b
commit 344b67c735

View File

@ -9,7 +9,7 @@ Write-Host "Enabling WinRM..."
winrm quickconfig -force
# Generate a self-signed certificate (Optional: Use your certificate if you have one)
$cert = New-SelfSignedCertificate -CertStoreLocation Cert:\LocalMachine\My -DnsName "hyperv-hostname.local" # (1)
$cert = New-SelfSignedCertificate -CertStoreLocation Cert:\LocalMachine\My -DnsName "$(Get-WmiObject -Class Win32_ComputerSystem).DomainName"
$certThumbprint = $cert.Thumbprint
# Function to delete existing HTTPS listener
@ -69,5 +69,3 @@ Set-ExecutionPolicy RemoteSigned -Force
Write-Host "Configuration complete. The Hyper-V host is ready for remote management over HTTPS with Kerberos authentication."
```
1. Make sure that you substitute this value with the fully qualified domain name of the server you are running this script on.