Use case · Microsoft 365
Change one user, not the whole tenant.
Graph, Entra ID, Exchange Online, Teams, SharePoint and Intune scripts, with the scopes they really need.
No card required. Your script is never executed.
Three patterns we flag
Loops over every user in the tenant
Get-MgUser -All | ForEach-Object { Update-MgUser -UserId $_.Id -AccountEnabled:$false }Asks for far more access than the job needs
Connect-MgGraph -Scopes "Directory.ReadWrite.All"Grants full access to every mailbox
Get-Mailbox -ResultSize Unlimited | Add-MailboxPermission -User helpdesk -AccessRights FullAccess
Sample: offboard-user.ps1
Real pattern, synthetic script. Unfiltered tenant-wide target.
What we check
- Unbounded -All and -ResultSize Unlimited queries
- Graph permission scopes (preview)
- Licence, sign-in and session changes
- Mailbox delegation and forwarding
Check the next script before it runs.