How did I properly offboard users in microsoft 365 with powershell
- User
How did I properly offboard users in microsoft 365 with powershell
Assistant
To properly offboard users in Microsoft 365 with PowerShell, you can follow these steps:
- Connect to the Microsoft 365 Admin Center:
Connect-Microsoft365Account
- Identify the users you want to offboard:
Get-M365User | Select UserPrincipalName
- Disable the users' accounts:
Get-M365User -UserPrincipalName user1@domain.com | Disable-M365Account
- Remove the users' licenses:
Get-M365User -UserPrincipalName user1@domain.com | Remove-M365License
- Remove the users from any groups they belong to:
Get-M365User -UserPrincipalName user1@domain.com | Remove-M365GroupMember
- Delete the users' email and OneDrive data:
Get-M365User -UserPrincipalName user1@domain.com | Remove-M365Mailbox
- Verify that the users' accounts have been deleted:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.