Remote management configuration in PowerShell

Remote management configuration in PowerShell

     I have learned PowerShell before, but I didn't use it, and I almost forgot about it after a while. Two new test machines have been added in the past two days. I just want to try remote inspection and fiddle with the remote management configuration. Workgroup mode+Windows2008 R2 Enterprise+PowerShell2.0.

     My work PC is called Server, and the server to be checked is called Client. Both Server and Client must enable Windows Remote Management (WS-Management) service.

1. Open PowerShell on the Client, execute Enable-PSRemoting –Force, then press the prompt to enter Y and press Enter, the system will automatically configure related functions.

2. Open PowerShell on the server and execute cd WSMan::localhost\client, which is to switch to the client directory of remote management.

(Because I am in workgroup mode, if it is a domain environment, it is not necessary, and the current user is automatically applied for authentication when connecting remotely.)

Then execute Get-ChildItem and see what children are there. Execute Set-Item ./TrustedHosts 192.168.1.111, and add the client's IP to the trusted host on the server.

192.168.1.111 is one of my DB servers. If you want to add more than one, separate the IPs with commas: Set-Item ./TrustedHosts '192.168.1.110,192.168.1.111,192.168.1.112'.

3. The configuration of remote management is completed here. To test it, execute it on the Server:

    $C=Get-Credential –Credential Administrator;Enter-PSSession –ComputerName   192.168.1.110 –Credential $C

   A box pops up asking to enter the username and password of the current server to connect to, I am using the administrator here.

   This is just a simple way to configure remote management purely in a workgroup situation, there are a lot of details and meaningful places not mentioned.

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326585654&siteId=291194637