Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 17778

PowerTip: Use PowerShell to Clear the Trusted Hosts File

$
0
0

Summary: Use Windows PowerShell to clear the trusted hosts file.

Hey, Scripting Guy! Question How can I use Windows PowerShell to clear all values from my trusted hosts file?

Hey, Scripting Guy! AnswerThe trusted hosts file is part of the WSMAN configuration, and the easiest way to clear it is to use Clear-Item:

£> Get-Item -Path WSMan:\localhost\Client\TrustedHosts | fl Name, Value

Name  : TrustedHosts

Value : server02,10.10.54.201

£> Clear-Item -Path WSMan:\localhost\Client\TrustedHosts -Force

£> Get-Item -Path WSMan:\localhost\Client\TrustedHosts | fl Name, Value

Name  : TrustedHosts

Value :

Note  If you don’t use the –Force parameter on Clear-Item, you must respond to a message asking you to confirm the action.


Viewing all articles
Browse latest Browse all 17778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>