Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tutorial:adm:configuration_-_winrm [2024/01/30 06:06] erbenr |
tutorial:adm:configuration_-_winrm [2024/02/05 05:29] (current) erbenr |
||
---|---|---|---|
Line 312: | Line 312: | ||
Now we have certificate which is imported in our windows server and now we can configure the HTTP listener | Now we have certificate which is imported in our windows server and now we can configure the HTTP listener | ||
+ | Create and export self signed certificate with powershell: | ||
+ | <code powershell> | ||
+ | $pathToCertificate=" | ||
+ | $hostname=' | ||
+ | $params = @{ | ||
+ | Subject = " | ||
+ | DnsName = ' | ||
+ | CertStoreLocation = ' | ||
+ | KeyExportPolicy =' | ||
+ | KeySpec =' | ||
+ | KeyLength =' | ||
+ | KeyAlgorithm = ' | ||
+ | HashAlgorithm = ' | ||
+ | } | ||
+ | |||
+ | $cert = New-SelfSignedCertificate @params | ||
+ | Export-Certificate -Cert $cert -FilePath " | ||
+ | $mypwd = ConvertTo-SecureString -String " | ||
+ | Export-PfxCertificate -Cert $cert -FilePath " | ||
+ | </ | ||
+ | |||
+ | List certificate in windows certificate storage: | ||
+ | <code powershell> | ||
+ | Get-ChildItem -Path Cert: | ||
+ | </ | ||
+ | |||
+ | Configure WinRM listener with HTTPS certficate: | ||
<code powershell> | <code powershell> | ||
winrm create winrm/ | winrm create winrm/ | ||
for deleting | for deleting | ||
winrm delete winrm/ | winrm delete winrm/ | ||
+ | </ | ||
+ | Create firewall rule for WinRM HTTPS: | ||
+ | <code powershell> | ||
+ | New-NetFirewallRule -Displayname 'WinRM - Powershell remoting HTTPS-In' | ||
</ | </ | ||
Restart WinRM | Restart WinRM | ||
- | |||
<code powershell> | <code powershell> | ||
Restart-Service winrm | Restart-Service winrm | ||
- | |||
</ | </ | ||
Line 329: | Line 358: | ||
+ | ===== Powershell 7 support ===== | ||
+ | |||
+ | Install powershell 7: https:// | ||
+ | |||
+ | Run app '' | ||
+ | <code powershell> | ||
+ | Enable-PSRemoting | ||
+ | </ | ||