If you’re like me I have to play with a lot of labs. I often use the same domain names to make my certificate life a little easier to manage. Maybe you just need to import certificates on a lot of servers. Either case this little snippet will make your certificate life a little easier :-).

  
      Welcome to the Exchange Management Shell!


VERBOSE: Connecting to Exchange Server.
VERBOSE: Connected to Exchange Server.

[PS] C:\PowerShell>$pfxpath = “C:\Certificates\contoso.com.pfx”
[PS] C:\PowerShell>$password = “MyPasswordIsSecure”
[PS] C:\PowerShell>Add-Type -AssemblyName System.Security
[PS] C:\PowerShell>$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2Collection
[PS] C:\PowerShell>$cert.Import($pfxpath, $password, ‘Exportable’)
[PS] C:\PowerShell>$cert
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s