Command Line
PowerShell Remoting Basics
Use authenticated PowerShell remoting on computers you are authorized to administer.
Follow the steps in order and stop if the screen or target does not match what is described. Use administrator access only when the task requires it.
Confirm authorization
Remote administration requires permission from the system owner and appropriate administrator policy.
Use managed configuration
Configure PowerShell remoting through organizational policy where possible. Avoid broad TrustedHosts entries.
Test WinRM
Test the target's WS-Management endpoint.
Command
Test-WSMan -ComputerName PC-NAMERun a read-only command
Use an explicit computer name and a credential handled by PowerShell's secure prompt.
Command
Invoke-Command -ComputerName PC-NAME -ScriptBlock { Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion }Close persistent sessions
Remove PSSessions when finished.
Command
Get-PSSession | Remove-PSSessionReview network exposure
Never expose WinRM directly to the public internet. Use firewalls, trusted network boundaries, and current authentication.