Configuring WSMan Remotely for multiple computers

by Nov 23, 2009

When working remotely in a peer-to-peer or cross-domain scenario, you will have to add all the computers you'd like to communicate with into the trusted hosts list. Unfortunately, when you try this, any new entry will overwrite the existing one, so there does not seem to be a way of adding multiple computer names:

Set-Item WSMan:\localhost\client\trustedhosts -force
Set-Item WSMan:\localhost\client\trustedhosts -force
Get-Item WSMan:\localhost\client\trustedhosts

As you see, only the last entry is stored in the list. You should make sure to run PowerShell with full administrative privileges and run Set-WSManQuickConfig beforehand if you cannot run the commands at all because of an access denied-error.

Use the -Concatenate switch to add new entries without overwriting existing entries:

Set-Item WSMan:\localhost\client\trustedhosts ` -force -concatenate

Twitter This Tip! ReTweet this Tip!