Skip to content

Instantly share code, notes, and snippets.

@z2z
Created April 19, 2018 11:01
Show Gist options
  • Save z2z/bbb9853204b2797c283bce90a3b3ba4a to your computer and use it in GitHub Desktop.
Save z2z/bbb9853204b2797c283bce90a3b3ba4a to your computer and use it in GitHub Desktop.
Generate Self Signed certificate for SSRS / PowerBI RS
New-SelfSignedCertificate -CertStoreLocation cert:\LocalMachine\my -dnsname $env:COMPUTERNAME
$Thumbprint = (Get-ChildItem -Path Cert:\LocalMachine\My | Where-Object {$_.Subject -match "$env:COMPUTERNAME"}).Thumbprint;
$pwd=ConvertTo-SecureString "p@ssw0rd" -asplainText -force
$file="C:\$env:COMPUTERNAME.pfx"
Export-PFXCertificate -cert cert:\LocalMachine\My\$Thumbprint -file $file -Password $pwd
Import-PfxCertificate -FilePath $file cert:\LocalMachine\root -Password $pwd
Remove-Item $file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment