Add TrustedHosts entry using PowerShell

Update TrustedHosts using PowerShell.

John Savill

July 3, 2016

1 Min Read
Add TrustedHosts entry using PowerShell

Q. How can I easily add entries to TrustedHosts using PowerShell?

A. TrustedHosts enable management via WS-Management of machines in a workgroup or different domain that have no trust relationship. To add machines to TrustedHosts use the following PowerShell which adds all machine in savilltech.net to the existing hosts.

$trusthosts = (Get-Item -Path WSMan:localhostClientTrustedHosts).ValueSet-Item -Path WSMan:localhostClientTrustedHosts "$trusthosts, *.savilltech.net" -Force

 

About the Author(s)

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