$webappName
=
"SharePoint Web Services"
if
(!(
Get-WebBinding
-name
$webappName
-protocol
"https"
-port
32844))
{
New-WebBinding
-name
$webappName
-ip
"*"
-port
32844
-protocol
"https"
}
$b
=
Get-WebBinding
-name
$webappName
-protocol
"https"
-port
32844
if
(
$b
)
{
$cert
=
get-childitem
cert:\\localmachine\sharepoint | where {
$_
.subject
-match
"^CN=SharePoint Services"
}
if
(!
$cert
)
{
throw
"Cannot find `"SharePoint Services`" certificate in SharePoint certificate store"
}
[void]
$b
.AddSslCertificate(
$cert
.ThumbPrint,
"SharePoint"
)
}
else
{
throw
"Cannot find webbinding"
}
if
(!(
Get-WebBinding
-name
$webappName
-protocol
"http"
-port
32843))
{
New-WebBinding
-name
$webappName
-ip
"*"
-port
32843
-protocol
"http"
}
Comments
Post a Comment