Commands › SharePoint Online

Remove-SPOUserProfile

SharePoint Online Microsoft.Online.SharePoint.PowerShell Remove-*

Remove user profile from the tenant.

Quick start script

# Remove-SPOUserProfile — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-SPOService -Url https://$org-admin.sharepoint.com

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-SPOUserProfile
$before | Format-List

# 3. Make the change
Remove-SPOUserProfile -LoginName <String>

# 4. Verify and diff
$after = Get-SPOUserProfile
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

Remove-SPOUserProfile -LoginName <String> [-UserId <String>] [<CommonParameters>]

Parameters (2)

ParameterTypeRequiredWhat it controls
-LoginName String yes Specifies the login name of the user profile to be deleted.
-UserId String Specifies the ID of the user profile to be deleted.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.