Powershell IIS7 Snap in Assign SSL certificate to https binding

后端 未结 4 2005
余生分开走
余生分开走 2021-01-11 15:29

As part of our automated build procedure we are trashing and reconstructing our IIS site with powershell scripts.

Once i have created the AppPool and the website com

4条回答
  •  北荒
    北荒 (楼主)
    2021-01-11 15:49

    You can make the script simpler like this:

    Get-ChildItem cert:\LocalMachine\Root | where { $_.Subject -like "YOUR STRING HERE*" } | select -First 1 | New-Item IIS:\SslBindings\0.0.0.0!443
    

    Use 0.0.0.0 to target all hosted IP's (equivalent to "*" in IIS Manager) or replace it with a specific IP if needed.

提交回复
热议问题