2011-05-11 45 views
3

我正嘗試使用powershell創建SSLBinding。我有一個證書存儲證書和我進行如下是否可以在不導航到IIS的情況下創建SSLBinding: SSLBindings

$certificate = Get-ChildItem cert:\ -Recurse | Where-Object {$_.FriendlyName -match $CertificateName } | Select-Object -First 1 

cd IIS:\SslBindings 

Get-Item $certificate | New-Item 0.0.0.0!$Port 

是有可能創造SSL,無需導航到IIS綁定:\ SslBindings?

問候, 哎呀

回答

3

你可以試一下,在你的背景:

PS C:\> new-item -path "IIS:\SslBindings\0.0.0.0!9004" -Value $certificate 

IP Address  Port Store   Sites 
----------  ---- -----   ----- 
0.0.0.0   9004 My 


PS C:\> dir IIS:\SslBindings 

IP Address  Port Store   Sites 
----------  ---- -----   ----- 
0.0.0.0   8172 MY 
0.0.0.0   9000 My 
0.0.0.0   9001 My 
0.0.0.0   9002 My 
0.0.0.0   9003 My 
0.0.0.0   9004 My 

現在我已經hable測試。

+0

謝謝,我試過這個,當我執行它的時候,我不確定類型是什麼,所以我把它留在那裏了!類型的價值應該是什麼? – JeeZ 2011-05-12 05:00:50

+0

對不起,我錯了(有點累)所以我編輯我的答案,現在似乎工作。 – JPBlanc 2011-05-12 07:00:17

相關問題