Modify TrustedHosts with PowerShell

Learn how to modify TrustedHosts with PowerShell.

John Savill

February 14, 2016

1 Min Read
Modify TrustedHosts with PowerShell

Q. How can I modify TrustedHosts using PowerShell?

A. To modify TrustedHosts using PowerShell leverage the WSMan provider and set the TrustedHosts value under localhostClient. For example to set TrustedHosts to every machine in your domain namespace use:

Set-Item -Path WSMan:localhostClientTrustedHosts -Value '*.savilltech.net'

To set to have no trusted hosts use:

Set-Item -Path WSMan:localhostClientTrustedHosts -Value ''

To avoid the prompt to make the change add -Force, for example:

Set-Item -Path WSMan:localhostClientTrustedHosts -Value '' -Force

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like