top of page

PowerShell | WinRM

If you take away anyyhing from my website please learn to use this.

PowerShell is a great tool and the main purpose is to gather information and or make changes to computer systems within a Domain. So it would be logical that it would have a way to connect to systems across the network. This access is called WinRM. This can easily be configured using group policy or it can be invoked manually by running PowerShell on the local machine and right click and Run As Administrator and enter:

winrm quickconfig


If you run Windows firewall you have to open the service / port on each machine. Again, this can easily be accomplished using group policy. Another item to keep in mind that if you have multiple networks layers / firewalls the port need to be opened for communication to each network / subnet.

Once you configure WinRM on a machine you can execute a statement like the one below . The code within the Scriptblock ($MyCommand) is executed on the remote machine and the return value is sent back you the originating system you executed your script from. This can be executed against and array of systems so you can run the same command on 5,10,2000 machines in parallel / multi-threaded. 

I have found that on most new server OS's like 2019, 2022 server this is enabled by default. I also find that most up to date Windows environments have this set up. 

bottom of page