Skip to content

Powershell Remoting

Joe Workman edited this page Jun 26, 2024 · 30 revisions

PowerShell Remoting is a feature of PowerShell that allows PowerShell to be called on remote machines. By default it is enabled on server o/s but not workstations.

It is possible to utilize 'Windows Group Policy' to enable PowerShell remoting by creating a GPO like the following

Microsoft Domain GPO:

Create a new GPO targeting OU containing systems to be migrated

After configuration, this GPO will enable WinRM and add a firewall exception to allow the WinRM traffic from the host system initiating the advanced deployment scripts.

new_gpo_winrm

Edit the GPO with the following settings:

  • Allow remote server management through WinRM
  • WinRM (WS-Management) service set to automatic startup
  • Firewall rule for Windows Remote Management on domain network profile locked down from Domain Controllers IP

edit_gpo_winrm

Computer Configuration > Administrative Tools > Windows Components > Windows Remote Management (WinRM) > WinRM Service > Allow remote server management through WinRM: allow_winrm_1

Configure the IPv4 filter to * to allow the WinRM listener to respond to requests.

allow_winrm_2

Computer Configuration > Policies > Windows Settings > Security Settings > System Services allow_winrm_3

Computer Configuration > Policies > Windows Settings > Security Settings > Windows Firewall with Advanced Security > Windows Firewall with Advanced Security allow_winrm_4

Add additional firewall rule scope to limit the WinRM rule to only apply to the servers IP

fwall_4

Verify GPO is pushed to workstation using the gpresult command:

gpresult /r /scope:computer

allow_winrm_6