< Back

Set-IisCert

Mon Jan 13, 2020 12:25 am

NAME Set-IisCert



SYNOPSIS

Updates an IIS binding to use the specified certificate





SYNTAX

Set-IisCert [-Certificate] <String> [-PfxPassword] <String> [-Port] <Int32> [-IisSite] <String> [-SniHostName]

<String> [<CommonParameters>]





DESCRIPTION

Compares the current certificate used by the binding to the specified certificate (based on thumbprint).

Certificate is stored in LocalMachine\\WebHosting certificate store.

Updates IIS binding certificate if thumbprint different.





PARAMETERS

-Certificate <String>



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-PfxPassword <String>



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Port <Int32>



Required? true

Position? 3

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-IisSite <String>



Required? true

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SniHostName <String>



Required? true

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

$True if binding was updated. $False if binding was not updated.





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Set-IisCert -Certificate $pfxCert -PfxPassword "!234SECRETbc123" -Port 443 -IisSite "Default Web Site"

-SniHostName "test.mysite.com"



Updates the IIS site's binding to use the specified certificate.











RELATED LINKS