How to update "Enabled Protocols" settings for a web application in IIS, using PowerShell script

Thasaiyan, Jeganathan 5 Reputation points
2023-11-16T04:45:07.7066667+00:00

How to update "Enabled Protocols" settings for a web application in IIS, using PowerShell script. Please refer the snapshot for more details.

enabledprotols

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 48,026 Reputation points
    2023-11-16T19:30:54.1133333+00:00

    Try this:

    Import-Module IISAdministration -Force          # you may not need to explicitly load this module
    $site = Get-IISSite -Name "<site-name-name-goes-here>"
    $app = $site.Applications | 
                Where-Object {$_.Path -eq "<application-path-goes-here>"}   # has leading /
    [string]$protos = $app.EnabledProtocols
    $protos += ",<additional-protocol-goes-here"    # NOTE LEADING COMMA! the list is a string of comma separated values
    $app.EnabledProtocols = $protos
    $m = Get-IISServerManager
    $m.CommitChanges()
    
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.