PowerShell Cheat Sheet

Searchable PowerShell cheat sheet for sysadmins: Active Directory, Entra ID, Azure, Exchange Online, Intune, networking, files, remoting and security one-liners. Filter by keyword — free, client-side only.

Loading...

How to use it

  1. Type a cmdlet name, topic or tag such as Get-ADUser, lockout, Exchange, Intune, remoting or Defender.
  2. Each result shows the command or one-liner, a short description and category tags (AD, Entra, Azure, Exchange, Intune, Network, Security and more).
  3. Copy carefully: some examples use placeholders like jdoe, contoso.com or <guid>. Confirm against your tenant and module version (AD, Az, ExchangeOnlineManagement, Microsoft.Graph) before running in production.

Related tools

Also try the Windows Event ID Lookup, Regex Tester (includes PowerShell -replace helpers) and UUID / Password Generator.

FAQ

What PowerShell modules do these examples need?

Many Active Directory examples need the RSAT ActiveDirectory module on Windows. Azure examples use Az.*. Exchange Online uses ExchangeOnlineManagement. Entra and Intune examples often use Microsoft.Graph. Install what you need from PSGallery (Install-Module) or enable RSAT Windows capabilities.

Does this cover PowerShell 5.1 and PowerShell 7?

Most one-liners work in Windows PowerShell 5.1 and PowerShell 7. A few notes call out PS 7+ features (ForEach-Object -Parallel, ConvertFrom-SecureString -AsPlainText). Graph and Az modules support both hosts on Windows.

Are these commands safe to run in production?

Treat them as a reference. Resetting passwords, unlocking accounts, changing firewall rules, domain joins and mail forwarding can disrupt users or security. Test in a lab, use -WhatIf where supported, and follow your change process.

How do I search for a topic quickly?

Use the filter box for a cmdlet (Get-Mailbox), an action (lockout, forwarding) or a tag (AD, Exchange, Security, Remoting). Clear the box to browse the full list.

Where can I learn more about a cmdlet?

In a PowerShell session run Get-Help CmdletName -Examples or Get-Help CmdletName -Online. For Microsoft 365, prefer current Microsoft Learn docs over outdated MSOnline/AzureAD samples when Graph equivalents exist.

Want the full kit?

Runbooks, checklists and helpdesk templates: IT Admin Packs on Gumroad.