The following powershell successfully updates the EnabledProtocols property for my WebSite "Test Services"
Set-ItemProperty 'IIS:\sites\Test Services' -name EnabledProtocols -Value
"http,net.tcp,net.pipe"
Are there any Powershell gurus here who know the syntax for setting the EnabledProtocols property for each WebApplication associated with the WebSite "Test Services"?
You need to find applications under a site using a where $_.Schema.Name -eq "Application"
. Then for each application using the Set-ItemProperty
, set enabledProtocols
property value.
Example
You should run the following script as administrator:
Import-Module WebAdministration -Force
Get-ChildItem "IIS:\sites\test" |
Where-Object {$_.Schema.Name -eq "Application"} |
ForEach-Object {
Set-ItemProperty $_.PSPath `
-name enabledProtocols -Value "http,net.tcp,net.pipe"}
Important Notes
WebAdministration
module is imported.)
Also pay attention to the enabledProtocols
name, with camel case syntax.