Error using appcmd to add ssl binding

Goldhorn picture Goldhorn · Mar 8, 2012 · Viewed 16.1k times · Source

I want to add a binding to a site using appcmd. But when I try the following command I get an error:

appcmd set site /site.name:"My site name" /+bindings.[protocol='https',bindingInformation='*:443:sub.mydomain.com'] 

The error:

ERROR ( message:Cannot find SITE object with identifier "bindingInformation='*:443:sub.mydomain.com']". )

I checked if the site exists and it does. What am I doing wrong?

Answer

northben picture northben · Sep 6, 2012

If you're using PowerShell, you have to surround the bindings parameter with double quotes so that PowerShell doesn't interpret the single quotes before the command is sent to appcmd.

./appcmd set site /site.name: contoso /+"bindings.[protocol='https',bindingInformation='*:443:']"

source: http://technet.microsoft.com/en-us/library/cc731692(v=ws.10).aspx