Ask a questionAsk a question
 

AnswerHow to remove an WinRM trusted host

  • Sunday, October 25, 2009 10:29 PMLouisb Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I accidently authorized a machine a a trusted host using winrm set winrm/config/client @{TrustedHosts="RemoteComputerName"}.  I now want to list the trusted host and remove the one that I don't want. 

    How do I perform this task?


    Thanks

Answers

  • Monday, October 26, 2009 12:06 AMMarco ShawMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    There's no way to remove a particular host or network from TrustedHosts, so you have to "reconstruct" the entire hash.

    DOS>winrm get winrm/config/client

    You'll need to get the entire entry from TrustedHosts, maybe copy it to Notepad, remove the entry you don't want, then use the 'set' to reset the variable:

    DOS>winrm set winrm/config/client @{TrustedHosts="foo,bar"}

All Replies

  • Monday, October 26, 2009 12:06 AMMarco ShawMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    There's no way to remove a particular host or network from TrustedHosts, so you have to "reconstruct" the entire hash.

    DOS>winrm get winrm/config/client

    You'll need to get the entire entry from TrustedHosts, maybe copy it to Notepad, remove the entry you don't want, then use the 'set' to reset the variable:

    DOS>winrm set winrm/config/client @{TrustedHosts="foo,bar"}