Advertisement
tankcr

ApplyCert

Aug 26th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $certdir = dir "Cert:\LocalMachine\root"
  2. # Update the binding with the certificate
  3. dir "Cert:\LocalMachine\root"
  4. dir "IIS:\SslBindings"
  5. $cert = "IIS:\SslBindings\0.0.0.0!443"
  6. # Grab the Certificate thumbprint
  7. $certThumb = Get-ChildItem -Path "Cert:\LocalMachine\root" | where-Object {$_.subject -like 'CN=PyrotekSACA*'} | Select-Object -ExpandProperty Thumbprint
  8. # Grab the Certificate and update the binding
  9. Remove-Item -Path $cert
  10. Get-Item cert:\localmachine\root\$certThumb | New-Item -Type Directory 0.0.0.0!443
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement