Remote management and automation with PowerShell
You manage domain Windows servers in bulk with PowerShell Remoting, schedule jobs and narrow rights with JEA.
Level 301 · 15 lessons · 12 practice labs
Lessons
Remoting
- How WinRM and PowerShell Remoting work
- Invoke-Command and persistent sessions
- Remoting to Linux and Windows over SSH
- Credentials and the double-hop problem
- Short task: collect a software inventory from every server
Managing Windows
- Users and groups with the ActiveDirectory module
- Services and event logs
- Hardware and configuration queries with CIM
- Scheduled tasks and background jobs
- Short task: add new staff to the domain from a CSV
Safe automation
- Limited endpoints with JEA
- Keeping passwords out of scripts with SecretManagement
- Script logs, transcripts and script block logging
- Short task: set up a help-desk endpoint that can only reset passwords
Wrap-up
- Capstone: audit and fix branch servers with one script
Practice labs
- One table from three servers: Collect uptime and operating system version from the lab servers with one command and show it as a sorted table that includes the server name.
- A remote script that can’t reach the second server: Prove the double-hop problem in a script that gets ‘access denied’ reaching a file share from a remote session, apply a fix that doesn’t expose the password and show the file is read.
- A server that refuses remote sessions: Find why one server refuses remote sessions while the others work by testing the service, the listener and the firewall rule, fix them all and verify with Invoke-Command.
- Accounts that haven’t logged in for a long time: Find accounts in the lab domain that are disabled or haven’t logged on for ninety days, and produce a CSV report with name, last logon date and unit.
- A bulk department move from CSV: Update group memberships and units for Copperleaf Insurance staff changing department from a CSV; show it with -WhatIf first, then apply and prove a second run changes nothing.
- A service that keeps stopping: Remotely find from event logs and dependencies why a service stops now and then on two servers, set its recovery options and report your findings with event ids.
- Servers about to run out of disk: Find drives below the free-space threshold on every lab server with a CIM query and list server, drive and percent free.
- A scheduled task set up remotely: Remotely register a scheduled task on a server that runs the daily clean-up script under a least-privilege account, trigger it once and show the last run result is success.
- An inventory with servers that don’t answer: Fan the inventory query out to servers as background jobs with a concurrency limit, handle timeouts on unreachable servers and merge successes and failures into one report.
- Session transcripts in one place: Enable PowerShell transcripts on the server to a central folder, open a remote session and show the commands you ran appear in the transcript.
- A plain-text password in a script: Move the service account password sitting in plain text in a scheduled script into a secret vault, change the script to read it from the vault and show it runs unattended.
- An endpoint that can only manage the print service: Set up a JEA endpoint for Harborview Hospital’s help desk that can only restart the print service and read its log, and prove other commands are blocked and the session runs under a virtual account.
About this course
You manage domain Windows servers in bulk with PowerShell Remoting, schedule jobs and narrow rights with JEA.
What you will learn
- Remoting
- Managing Windows
- Safe automation
- Wrap-up
Prerequisites
You should be comfortable with the level 101 and 201 topics of the same path.
Lab environment
Lessons run in a Kali Linux terminal in the browser and in a practice domain (CORP.LAB) set up separately for every lab. Nothing to install.
Frequently asked questions
- Is this course right for my level?
- The course is at level 301; it assumes you know the topics of the lower-level courses.
- Is there anything to install?
- No. Every lesson runs in your own lab environment that opens in the browser.
- How do lessons work?
- Each lesson has 8 to 10 steps and a short quiz. Early steps show the command to type, later steps give less help; if two attempts fail, the solution opens.
- Can I try it for free?
- Yes. The first three lessons of every course are free.