PowerShell Console · Remote Server Management

Hands Off the Keyboard

Manage a Windows server over WinRM — enable remoting, work in a session, then fan out a single command. No RDP.

Windows PowerShell local session
PS C:\>

Change #CR-2208

You need to run a couple of quick checks on ops-srv-12 (management IP 10.30.4.20) — but you don’t want to tie up a graphical RDP session just to read a service state and an IP config.

Enable remoting on the target, drop into an interactive session, verify a service, then pull the server’s IP configuration with a single non-interactive call and disconnect. Bad cmdlets and bad parameters return real error text — read it, that’s the point.

Tasks

  • Enable remoting on the target — Enable-PSRemoting
  • Open an interactive session — Enter-PSSession -ComputerName ops-srv-12
  • In the session, check a service — Get-Service
  • Pull the IP config in one non-interactive call — Invoke-Command -ComputerName ops-srv-12 -ScriptBlock { ipconfig }
  • Close the session — Exit-PSSession

Questions

1. Which protocol and default port does PowerShell remoting use?
2. When would you use Invoke-Command instead of Enter-PSSession?
3. Why is remoting preferable to RDP for managing many servers at once?
4. Which cmdlet turns on remoting on the target host?

Submit

0 / 9
N10-009 · 4.4 N10-009 · 5.5 APNET · 4.3.A