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:51] – erbenr | tutorial:adm:configuration_-_winrm [2025/10/07 10:28] (current) – [Permission configuration] klimad | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| <code powershell> | <code powershell> | ||
| Test-WSMan | Test-WSMan | ||
| + | |||
| </ | </ | ||
| Line 15: | Line 16: | ||
| If you get some error then you need to do the [[https:// | If you get some error then you need to do the [[https:// | ||
| + | < | ||
| + | |||
| + | winrm quickconfig | ||
| + | |||
| + | </ | ||
| Now execute the first command again and it should without error now. | Now execute the first command again and it should without error now. | ||
| + | |||
| ===== Show current configuration ===== | ===== Show current configuration ===== | ||
| Line 92: | Line 99: | ||
| <code powershell> | <code powershell> | ||
| - | winrm set winrm/ | + | winrm set winrm/ |
| - | {{.: | + | |
| winrm set winrm/ | winrm set winrm/ | ||
| Enable-WSManCredSSP -Role Server | Enable-WSManCredSSP -Role Server | ||
| - | |||
| </ | </ | ||
| - | |||
| ===== Permission configuration ===== | ===== Permission configuration ===== | ||
| Line 105: | Line 109: | ||
| Now we need to set the right permissions. It's tested against NTLM, Kerberos and CredSSP auth It's tested with local user + group and with domain user + group. For the following steps you can use one of these groups WinRMRemoteWMIUsers\_\_ or Remote Management Users It should work with both. | Now we need to set the right permissions. It's tested against NTLM, Kerberos and CredSSP auth It's tested with local user + group and with domain user + group. For the following steps you can use one of these groups WinRMRemoteWMIUsers\_\_ or Remote Management Users It should work with both. | ||
| - | Assign user into group Set WMI access for group. | + | **Assign |
| - | * Computer Management → Services and Application → right click WMI Control → Properties * In new dialog window → tab Security → Root → CIMV2 and click button Security * Next dialog window will appear - you need to add group (WinRMRemoteWMIUsers\_\_ or Remote Management Users) here * You need to select these options in the checkboxes - Execute Methods, Enable Account and Remote Enable * Click on Advanced - select and edit group → Set " | + | Set WMI access for group. |
| + | |||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| {{.: | {{.: | ||
| Line 118: | Line 129: | ||
| </ | </ | ||
| - | {{.: | + | {{.: |
| + | | ||
| + | | ||
| <code powershell> | <code powershell> | ||
| Line 214: | Line 227: | ||
| </ | </ | ||
| - | To turn the credentials delegation on. Open Group policy setting and navigate to Computer | + | To turn the credentials delegation on. Open Group policy setting and navigate to Computer |
| The Allow Delegating Fresh Credentials (AllowFreshCredentials) policy setting must be enabled. If it's enabled validate if correct value (values) are added to this policy. The correct value is WSMAN/SPN of your server. For example | The Allow Delegating Fresh Credentials (AllowFreshCredentials) policy setting must be enabled. If it's enabled validate if correct value (values) are added to this policy. The correct value is WSMAN/SPN of your server. For example | ||
| Line 315: | Line 328: | ||
| <code powershell> | <code powershell> | ||
| $pathToCertificate=" | $pathToCertificate=" | ||
| - | $hostname=' | + | $hostname=' |
| $params = @{ | $params = @{ | ||
| Subject = " | Subject = " | ||
| - | DnsName = 'bear.zoo.bcv' | + | DnsName = 'ad.idstory.idm' |
| CertStoreLocation = ' | CertStoreLocation = ' | ||
| KeyExportPolicy =' | KeyExportPolicy =' | ||
| Line 327: | Line 340: | ||
| } | } | ||
| - | #$cert = New-SelfSignedCertificate -Subject " | ||
| $cert = New-SelfSignedCertificate @params | $cert = New-SelfSignedCertificate @params | ||
| Export-Certificate -Cert $cert -FilePath " | Export-Certificate -Cert $cert -FilePath " | ||
| Line 346: | Line 358: | ||
| </ | </ | ||
| - | Restart | + | Create firewall rule for WinRM HTTPS: |
| + | <code powershell> | ||
| + | New-NetFirewallRule -Displayname 'WinRM - Powershell remoting HTTPS-In' | ||
| + | </ | ||
| + | Restart WinRM | ||
| <code powershell> | <code powershell> | ||
| Restart-Service winrm | Restart-Service winrm | ||
| - | |||
| </ | </ | ||
| Line 356: | Line 371: | ||
| + | ===== Powershell 7 support ===== | ||
| + | |||
| + | Install powershell 7: https:// | ||
| + | |||
| + | Run app '' | ||
| + | <code powershell> | ||
| + | Enable-PSRemoting | ||
| + | </ | ||