Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. # Call as .\thumbprint.ps1 $PWD\example_cert
  2. $CertificatePath = $Args[0]
  3. $certificateObject = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
  4. $certificateObject.Import($CertificatePath, $sSecStrPassword, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::DefaultKeySet)
  5. $expectedThumbprint = $certificateObject.Thumbprint
  6. echo $expectedThumbprint
  7. # To verify a cert's thumbprint is imported:
  8. # Get-ChildItem -Recurse Cert:\\LocalMachine | findstr -i <thumbprint>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement