Trusted hosts

If a remote system is not part of a domain, or is part of an untrusted domain, an attempt to connect using remoting may fail. The remote system must either be listed in trusted hosts or use SSL.

Use of trusted hosts also applies when connecting from a computer on a domain to another computer that is using a local user account.

Trusted hosts are set on the client, that is, the system making the connection. The following command gets the current value:

Get-Item WSMan:localhostClientTrustedHosts 

The value is a comma-delimited list. Wildcards are supported in the list. The following function may be used to add a value to the list:

function Add-TrustedHost { 
    param ( 
        [String]$Hostname 
    ) 
 
    $item = Get-Item WSMan:localhostClientTrustedHosts 
    $trustedHosts = @($item.Value -split ',') 
    $trustedHosts = $trustedHosts + $Hostname | 
        Where-Object { $_ } | 
        Select-Object -Unique 
 
    $item | Set-Item -Value ($trustedHosts -join ',') 
} 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.198.49