RSS

Exchange 2010的证书申请大有不同嘛

23 Jan

做exchange项目中最重要的一环就是证书的申请,之前有多篇文章描述了如何去申请Exchange 2007的证书。但到了 Exchange 2010,似乎有所不同哦。本文描述了两者的区别:

Exchange 2007

Generate request

New-ExchangeCertificate -GenerateRequest -Path c:\xunyangit.req -KeySize 2048 -SubjectName "c=Cashcat, s=Cashcat, l=Cashcat, o=Cashcat Pte Ltd, ou=Exchange, cn=xunyangit.com" -DomainName xunyangit.com, autodiscover.xunyangit.com, mail.xunyangit.com -PrivateKeyExportable $True

Import Certficate and Enable services

For .cer

Import-ExchangeCertificate -Path C:\xunyangit.cer | Enable-ExchangeCertificate -Services "IIS,POP,IMAP"

For .pfx

Import-ExchangeCertificate -Path c:\xunyangit.pfx -Password:(Get-Credential).password | Enable-ExchangeCertificate -Services "IIS,POP,IMAP"

Exchange 2010

Generate request

New-ExchangeCertificate -GenerateRequest -KeySize 2048 -SubjectName "c=Cashcat, s=Cashcat, l=Cashcat, o=Cashcat Pte Ltd, ou=Exchange, cn=xunyangit.com" -DomainName xunyangit.com, autodiscover.xunyangit.com, mail.xunyangit.com -PrivateKeyExportable $True

你会发现,-path开关在exchange 2010中消失了!所以要这么去做:

$Data = New-ExchangeCertificate -GenerateRequest -KeySize 2048 -SubjectName "c=Cashcat, s=Cashcat, l=Cashcat, o=Cashcat Pte Ltd, ou=Exchange, cn=xunyangit.com" -DomainName xunyangit.com, autodiscover.xunyangit.com, mail.xunyangit.com -PrivateKeyExportable $True
Set-Content -path "C:\xunyangit.req" -Value $Data

Import Certficate and Enable services

For .cer

Import-ExchangeCertificate -FileData ([Byte[]]$(Get-Content -Path c:\xunyangit.cer -Encoding byte -ReadCount 0)) | Enable-ExchangeCertificate -Services "IIS,POP,IMAP"

For .pfx

Import-ExchangeCertificate -FileData ([Byte[]]$(Get-Content -Path c:\xunyangit.pfx -Encoding byte -ReadCount 0)) -Password:(Get-Credential).password| Enable-ExchangeCertificate -Services "IIS,POP,IMAP"

 

TIPs:

看help是一项基本的学习能力。

Advertisements
 
1 Comment

Posted by on January 23, 2010 in Exchange Server

 

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

 
%d bloggers like this: