- Create a self-signed certificate on SRV1, copy it to the local machine's root store, and then display it:
Get-ChildItem -Path Cert:LocalMachine\My | Where-Object Subject -eq 'CN=SRV1' | Remove-Item -Force $DscCert = New-SelfSignedCertificate ` -CertStoreLocation 'CERT:\LocalMachine\MY' ` -DnsName 'SRV1' $C = 'System.Security.Cryptography.X509Certificates.X509Store' $Store = New-Object -TypeName $C -ArgumentList 'Root','LocalMachine' $Store.Open('ReadWrite') $Store.Add($Dsccert) $Store.Close() $DscCert
- Copy the certificate to the root store on SRV2 and ensure it's the only one:
$Sb = { Param ($Rootcert) Get-ChildItem Cert:LocalMachine\Root | Where Subject -eq 'CN=SRV1' | Remove-Item -Force $C = 'System.Security.Cryptography.X509Certificates.X509Store' ...