Powershell Remoting

Powershell Remoting

December 4, 2023

From Microsoft’s documentation though it doesn’t quite behave the way I am use to using something like SSH.

You can use Get-Command can be used with the ParameterName parameter to determine what commands have a ComputerName parameter.

> Get-Command -ParameterName ComputerName

CommandType     Name                           Version    Source
-----------     ----                           -------    ------
Cmdlet          Add-Computer                   3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Clear-EventLog                 3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Connect-PSSession              3.0.0.0    Microsoft.PowerShell.Core
Cmdlet          Enter-PSSession                3.0.0.0    Microsoft.PowerShell.Core
Cmdlet          Get-EventLog                   3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Get-HotFix                     3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Get-Process                    3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Get-PSSession                  3.0.0.0    Microsoft.PowerShell.Core
Cmdlet          Get-Service                    3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Get-WmiObject                  3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Invoke-Command                 3.0.0.0    Microsoft.PowerShell.Core
Cmdlet          Invoke-WmiMethod               3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Limit-EventLog                 3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          New-EventLog                   3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          New-PSSession                  3.0.0.0    Microsoft.PowerShell.Core
Cmdlet          Receive-Job                    3.0.0.0    Microsoft.PowerShell.Core
Cmdlet          Receive-PSSession              3.0.0.0    Microsoft.PowerShell.Core
Cmdlet          Register-WmiEvent              3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Remove-Computer                3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Remove-EventLog                3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Remove-PSSession               3.0.0.0    Microsoft.PowerShell.Core
Cmdlet          Remove-WmiObject               3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Rename-Computer                3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Restart-Computer               3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Send-MailMessage               3.1.0.0    Microsoft.PowerShell.Utility
Cmdlet          Set-Service                    3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Set-WmiInstance                3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Show-EventLog                  3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Stop-Computer                  3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Test-Connection                3.1.0.0    Microsoft.PowerShell.Management
Cmdlet          Write-EventLog                 3.1.0.0    Microsoft.PowerShell.Management

To enable remoting, it must be enabled on the remote PC:

> Enable-PSRemoting

WinRM has been updated to receive requests.
WinRM service type changed successfully.
WinRM service started.

WinRM has been updated for remote management.
WinRM firewall exception enabled.

One To One Remoting

> Enter-PSSession -ComputerName dc01

[dc01]: PS C:\Users\Administrator\Documents>