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 [2024/11/21 09:04] (current) – [Check if Winrm is running] erbenr | ||
---|---|---|---|
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 107: | Line 111: | ||
Assign user into group Set WMI access for group. | Assign user into group Set WMI access for group. | ||
- | * 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 " | + | |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
{{.: | {{.: | ||
Line 118: | Line 127: | ||
</ | </ | ||
- | {{.: | + | {{.: |
+ | | ||
+ | | ||
<code powershell> | <code powershell> | ||
Line 214: | Line 225: | ||
</ | </ | ||
- | 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 326: | ||
<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 338: | ||
} | } | ||
- | #$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 356: | ||
</ | </ | ||
- | 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 369: | ||
+ | ===== Powershell 7 support ===== | ||
+ | |||
+ | Install powershell 7: https:// | ||
+ | |||
+ | Run app '' | ||
+ | <code powershell> | ||
+ | Enable-PSRemoting | ||
+ | </ | ||