Skip to content
SysA&E

PowerShell snippet library

Searchable snippets for Active Directory, Entra ID, Exchange Online and Azure.

Runs in your browser. Nothing you enter leaves this device.

Loading tool…

What this tool does

The commands you look up again every few months, in one searchable place. Each snippet is ready to copy, uses current modules (Microsoft Graph and Az, not the retired AzureAD and MSOnline modules) and says what it needs to run.

How to use it

  1. Search by task, cmdlet or keyword, or filter by product.
  2. Copy the snippet and replace the placeholder names with your own.
  3. Read a snippet before running it, and try anything that changes data on a test object first.

Questions and answers

Which modules do I need?

ActiveDirectory (part of RSAT) for on-premises AD, Microsoft.Graph for Entra ID, ExchangeOnlineManagement for Exchange Online and Az for Azure. Install the last three with Install-Module.

Why not the AzureAD or MSOnline cmdlets?

Microsoft has retired both modules. The Microsoft Graph PowerShell SDK is the supported replacement, so every Entra ID snippet here uses it.

Are these safe to run in production?

Read-only snippets (Get-, Search-) are safe. Snippets that change something are marked; test them against a single object and add -WhatIf where the cmdlet supports it.