Q. How can I modify TrustedHosts using PowerShell?
A. To modify TrustedHosts using PowerShell leverage the WSMan provider and set the TrustedHosts value under localhost\Client. For example to set TrustedHosts to every machine in your domain namespace use:
Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value '*.savilltech.net'
To set to have no trusted hosts use:
Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value ''
To avoid the prompt to make the change add -Force, for example:
Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value '' -Force
0 comments
Hide comments