Kamis, 20 September 2018

How To Enable Psremoting To Execute Powershell Script From Remote Machine.


PSRemoting (PowerShell Remote execution) - PowerShell Remoting allow yous run PowerShell ascendancy or Access amount PowerShell Session on remote Windows System. In other words, it's similar to SSH for accessing remote terminals from Remote computers.

PSRemoting disabled yesteryear default, you've to enable  PSRemoting earlier using it. 
Let's follow the procedure below to enable PSRemoting.


Prerequisites- 

  • Two Windows PC amongst Admin Rights.
  • One primary PC that nosotros volition access remotely.
  • Another to Run in addition to access PS of PC1.
Step 1- Enable PSRemoting (The PC volition access Remotely) - Let's follow the steps below to enable PSRemoting.
  • Open PowerShell every bit an Administrator account.

  • In the Powershell Window, Run the next ascendancy in addition to hitting Enter key
Enable-PSRemoting -Force















This ascendancy starts the WinRM service, sets it to starting fourth dimension automatically amongst your system, in addition to creates a firewall dominion that allows incoming connections. The -Force usage of the cmdlet tells PowerShell to perform these actions without prompting yous for each step.
If you're working on Domain network that is the procedure in addition to yous are cook to execute the Powershell ascendancy from the Remote PC.

Step 2- Follow the below procedure for Workgroup environment.
While you're working on homework or workgroup network hence yous conduct keep to trust your PC to connect remotely. 
Run the ascendancy below on the PC from where yous would to similar execute the commands.
Set-Item wsman:\localhost\client\trustedhosts *
The asterisk is a wildcard symbol for all PCs. If instead yous desire to limit computers that tin connect, yous tin supplant the asterisk amongst a comma-separated listing of IP addresses or figurer names for approved PCs.

After running that command, you’ll postulate to restart the WinRM service hence your novel settings conduct keep effect. Type the next cmdlet in addition to hence hitting Enter:

Restart-Service WinRM

All done, Now, you're cook to execute PowerShell script from a Remote computer.


Thank yous really much for reading my Blog, Please comment below whatever proposition or feedback to improve my Blog.


Sumber https://linuxhowtoguide.blogspot.com/

Tidak ada komentar:

Posting Komentar