Powershell winrm trusted hosts not working

I am trying to configure remote control of multiple machines. I can successfully execute commands on a remote computer from my computer, but I do not want anyone to be able to do this.

I tried installing trusted hosts on the remote computer and restarted the service, but it seems to be doing nothing.

For example, on a remote computer:

 winrm set winrm/config/client '@{TrustedHosts="someIncorrectName"}'

Then restart the winrm service.

Why can I still run remote commands from my laptop? Should you prevent the execution of a command?

I run the command as follows:

Invoke-Command -cn remoteMachine -Credential $cred -scriptblock {get-process}

Where $ cred was created using get-credential domain / username.

TrustedHosts, , , , . , , , , " ". , , .

MSDN : " , ". , ( , ).

?

+5
1

TrustedHosts , , , . Unix.rhosts, PowerShell, . :

WSMan:\localhost\Client

, Service node.

, - , NTLM-- . ? - . , SSL, AllowUnencrypted = $false, Client node WSMAN.

, ? WSMAN:\localhost\Service node . , :

   WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Service

Type            Name                           SourceOfValue   Value                                                                       
----            ----                           -------------   -----                                                                       
System.String   RootSDDL                                       ...    
System.String   MaxConcurrentOperations                        4294967295                                                                  
System.String   MaxConcurrentOperationsPerUser                 1500                                                                        
System.String   EnumerationTimeoutms                           240000                                                                      
System.String   MaxConnections                                 300                                                                         
System.String   MaxPacketRetrievalTimeSeconds                  120                                                                         
System.String   AllowUnencrypted                               false                                                                       
Container       Auth                                                                                                                       
Container       DefaultPorts                                                                                                               
System.String   IPv4Filter                                     *                                                                           
System.String   IPv6Filter                                     *                                                                           
System.String   EnableCompatibilityHttpList...                 false                                                                       
System.String   EnableCompatibilityHttpsLis...                 false                                                                       
System.String   CertificateThumbprint                                                                                                      
System.String   AllowRemoteAccess                              true                                                                        

, , , IPv4Filter IPv6Filter. , ; -)

+6

All Articles