O'Reilly logo

Windows Server 2016 Automation with PowerShell Cookbook - Second Edition by Thomas Lee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

In step 1, you create a self-signed certificate with a subject name of SRV1. The New-SelfSignedCertificate creates this certificate in the local machine's MY folder. There is no output from this step, but the certificate is stored in the $DscCert variable for use in the next step. This recipe uses this certificate to provide SSL access to the DSC web service.

In step 2, you copy the certificate to the root store on SRV2. Unfortunately, the certificate provider in PowerShell does not support copying a certificate from one store to another, so you need to dip down into the .NET framework to add the self-signed certificate held in $DscCert to the SRV2 server's local machine trusted root store. This has the effect of enabling ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required