zettelkasten/OneNoteExport/Technik/Windows Server/19_Configure WinRM to Use HTTPS.md
2023-08-17 19:32:37 +02:00

3.0 KiB

Configure WinRM to Use HTTPS

Dienstag, 9. Januar 2018

12:48

 

You can configure the WinRM host to enable communication with the PowerShell plug-in through the HTTPS protocol.

The WinRM host requires a certificate so that it can communicate through the HTTPS protocol. You can either obtain a certificate or generate one. For example, you can generate a self-signed certificate by using the Certificate Creation tool (makecert.exe) that is part of the .NET Framework SDK.

Prerequisites

Verify that you can access the Microsoft Management Console (mmc.exe) on the WinRM host.

Procedure

1

Generate a self-signed certificate.

The following command line contains example syntax for creating a certificate on the WinRM host by using makecert.exe.

makecert.exe -r -pe -n "CN=host_name-3,O=organization_name" -e mm/dd/yyyy -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 certificate_name.cer

2

Add the generated certificate by using the Microsoft Management Console.

a Run mmc.exe.
b Select File > Add/Remove Snap-in.
c From the list of available snap-ins, select Certificates and click Add.
d Select Computer account and click Next.
e Click Finish.
f

Verify that the certificate is installed in Console Root > Certificates (Local Computer) > Personal > Certificates and Console Root > Certificates (Local Computer) > Trusted Root Certification Authorities > Certificates.

If the certificate is not installed in the Trusted Root Certification Authorities and Personal folders, you must install it manually.

3

Create an HTTPS listener by using the correct thumbprint and host name.

The following command line contains example syntax for creating an HTTPS listener.

winrm create winrm/config/Listener?Address=*+Transport=HTTPS @{Hostname="host_name";CertificateThumbprint="certificate_thumbprint"}

4

Test the connection.

The following command line contains example syntax for testing the connection.

winrs -r:https://host_name:port_number -u:user_name -p:password hostname"}

 

Aus <https://pubs.vmware.com/orchestrator-plugins/topic/com.vmware.using.powershell.plugin.doc_10/GUID-2F7DA33F-E427-4B22-8946-03793C05A097.html>