Display: Cloud | List
Most Popular Tags
Results (7 total) All > powershell (x) > certificateauthority.admin.1 (x)
Simplified Example using PowerShell (ICertAdmin2::GetMyRoles method (Windows))
<#.SYNOPSIS This script displays the CA roles of the caller.DESCRIPTION This script instantiates the CA COM object, gets the allowed roles, and displays them. This script also shows use of Bitwise And operations, typical when using output from API calls..NOTES File Name : Get-CARolesofCaller.ps1 Author : Thomas Lee - tfl@psp.co.uk Requires : PowerShell V2.LINK T
Last modified by Thomas Lee on 10/24/2009 6:42:38 PM
Object creation in PowerShell (ICertAdmin2 interface (Windows))
# To access this interface in PowerShell - it is necessary to create a com object# The COM Object type is: CertificateAuthority.Admin.1# More detailed scripts will always show the com object creation, then# some use of what's created.# Create com object$CertAdmin = New-Object -com "CertificateAuthority.Admin.1"
Last modified by Vadims Podans on 11/3/2009 8:49:00 PM
Example in Powershell (ICertAdmin2::PublishCRLs method (Windows))
# Create the com object$CertAdmin = New-Object -com "CertificateAuthority.Admin.1"# publish Base CRL only$CertAdmin.PublishCRLs("servername\caname", 0, 1)# publish Delta CRL only$CertAdmin.PublishCRLs("servername\caname", 0, 2)
Last modified by Vadims Podans on 11/3/2009 7:15:50 PM
Example in PowerShell (ICertAdmin2::RevokeCertificate method (Windows))
# Create COM object$CertAdmin = New-Object -com CertificateAuthority.Admin# Revoke certificate with serial number 6ef5e9aa00000000008f# on CA with CAName that is hosted on computer named ServerName with# Superseded reason. Certificate will considered as revoked in 24 hours$CertAdmin.RevokeCertificate("ServerName\CAName","6ef5e9aa00000000008f",4, (Get-Date).AddDays(1).ToUniversalTime())
Last modified by Vadims Podans on 8/25/2012 5:59:57 PM
Example in PowerShell (ICertAdmin2::GetRevocationReason method (Windows))
# Create the COM object$CertAdmin = New-Object -com "CertificateAuthority.Admin.1" # At first we need to get a disposition. And output should be 2 (indicates that certificate is revoked)$CertAdmin.IsValid("ServerName\CAName", "6ef5e9aa00000000008f") # Now check revocation reason$CertAdmin.GetRevocationReason() # return value represents a revocation reason. 0 means CRL_REASON_UNSPECIFIED, 1 — C
Last modified by Thomas Lee on 10/24/2009 2:26:08 PM
Example in PowerShell (ICertAdmin2::IsValidCertificate method (Windows))
# Create the com object$CertAdmin = New-Object -com "CertificateAuthority.Admin.1" # Check Validity$CertAdmin.IsValid("ServerName\CANAme","6ef5e9aa00000000008f")# return value represents certificate disposition status. 0 means CA_DISP_INCOMPLETE, 1 — CA_DISP_ERROR, etc.
Last modified by Thomas Lee on 10/24/2009 2:24:08 PM
Example in PowerShell (ICertAdmin2::GetCRL method (Windows))
# Create admin object$CertAdmin = New-Object -com "CertificateAuthority.Admin.1"# Get CRL to Base64 encoded format $CRL = $CertAdmin.GetCRL("ServerName\CAName", 1)# Convert Base 64 string to byta array$bytes = [System.Convert]::FromBase64String($CRL)# Write this array to regular .CRL file[System.IO.File]::WriteAllBytes('file.crl', $bytes)# to open this file, just invoke it & .\file.crl
Last modified by Thomas Lee on 10/24/2009 2:01:48 PM
Page view tracker