breakfixlearn.com

IT-05IT Support

Active Directory & Microsoft 365 account tasks

Use this when: you unlock, reset, create or offboard users in Active Directory, Entra ID and Exchange Online.

IT-05 Active Directory & Microsoft 365 account tasks cheat sheet. Every table on it is repeated as text below.
Tap the sheet for the full-size image. The text version below is screen-reader friendly.

Text version

Everything on the sheet, as plain HTML: handy for screen readers, copy-paste and search.

Offboarding a leaver: do it in this order

Record each step in the ticket.

  1. Disable the AD account and the Entra ID account.
  2. Revoke sessions to kill refresh tokens in Entra ID.
  3. Reset the password to a random value; twice if compromise is suspected.
  4. Mailbox: convert it to shared and give the manager access.
  5. Licenses: remove them once the mailbox is shared.
  6. Groups: remove the user and move the account to a Disabled OU.
  7. Devices: retire or wipe them, and collect the hardware.
  8. Hand over files and shared drives, and remove MFA methods.

These need the RSAT ActiveDirectory module. Set $pw = Read-Host -AsSecureString first so the password never appears on screen or in history.

CommandWhat it does
Get-ADUser jdoe -Properties LockedOut, PasswordLastSet, LastLogonDateStatus at a glance
Unlock-ADAccount -Identity jdoeUnlock
Set-ADAccountPassword jdoe -Reset -NewPassword $pwReset the password
Disable-ADAccount -Identity jdoeDisable
Get-ADPrincipalGroupMembership jdoe | Select-Object NameGroups the user is in
Add-ADGroupMember SALES -Members jdoeAdd to a group
Search-ADAccount -AccountInactive -TimeSpan 90.00:00:00 -UsersOnlyAccounts unused for 90 days

Entra ID and Exchange Online

Use Microsoft Graph PowerShell. The MSOnline and AzureAD modules are retired.

CommandWhat it does
Connect-MgGraph -Scopes "User.ReadWrite.All"Sign in to Graph
Update-MgUser -UserId $id -AccountEnabled:$falseBlock sign-in
Revoke-MgUserSignInSession -UserId $idRevoke sessions
Get-MgUserLicenseDetail -UserId $idList licenses
Set-MgUserLicense -UserId $id -RemoveLicenses @($skuId) -AddLicenses @{}Remove a license
Connect-ExchangeOnline, then Set-Mailbox jdoe -Type SharedConvert to a shared mailbox
Add-MailboxPermission jdoe -User manager -AccessRights FullAccessGive the manager access

A shared mailbox holds up to 50 GB with no license. Keep sign-in blocked on it.

Stay safe

Danger. Verify identity before any reset or unlock: call back on the number on file, not one in the ticket.

Caution. After a revoke, apps may keep working until their access token expires (about 1 hour by default).

Caution. Use the Helpdesk Administrator or User Administrator role, not Global Administrator. Never put passwords in tickets.

Remember

  • Disable first, delete later
  • Convert the mailbox before removing the license
  • For synced users, make changes in on-prem AD

Sources

Go deeper on the blog