I am new to system administration and want to get more useful with PowerShell across Windows, Active Directory, Azure, and Microsoft 365. What commands or modules are worth learning for everyday work?
What PowerShell commands should a new sysadmin learn first?
Answers
Start with Get-Command, Get-Help, and Get-Member rather than trying to memorize a giant command list. Commands generally follow a Verb-Noun pattern, so Get-Command *-Service is a useful way to discover options. Get-Help Get-Service -Examples shows how a command is used.
PowerShell passes objects through the pipeline, not just text. Try Get-Service | Get-Member to see the properties and methods available, then use Select-Object to choose the properties you need. Tab completion helps when you remember part of a command or parameter.
Reply to this answer
The Active Directory module is a good place to turn repetitive account checks into quick queries. For example, Get-ADUser can retrieve an account, and Select-Object can narrow the output to fields such as Name, SamAccountName, and Enabled.
Pick a task you already understand in the graphical tools and reproduce the read-only check first. Once the output is right, you can build on it for batches instead of clicking through accounts one at a time.
Reply to this answer
For connectivity checks, keep Test-NetConnection handy. Test-NetConnection server.example -Port 443 checks whether a TCP connection to that port succeeds. It is a quick way to distinguish a port problem from a more general name or network issue.
Reply to this answer
If your environment uses Microsoft Entra Connect Sync, Start-ADSyncSyncCycle -PolicyType Delta can trigger a delta synchronization instead of waiting for the scheduled cycle. That is a useful command to recognize when troubleshooting directory sync.
Keep access to the sync server tightly controlled. The convenience of triggering a sync is not a reason to give broad access to a sensitive server.
Reply to this answer
Make the shell easier to use as well. PSReadLine's Ctrl+R history search can find a long command you ran earlier, and Get-Clipboard is useful when you need to work through a copied list of account names.
Before running anything that changes accounts or configuration, check the target list and test carefully. Generated scripts can be useful starting points, but still need review and a way to check for failures.
Reply to this answer
Add your answer
Answers are reviewed before publication.
_e92!plaidwrench.5:
Show-Command Get-Service is handy too. It opens a graphical interface for exploring the command and its parameters.