Commands › Exchange Online
Remove-UserPhoto
Delete the photo associated with a user's account. The user photo feature allows users to associate a picture with their account. User photos appear in client applications, such as Outlook, Microsoft Teams, and SharePoint. **Note**: In Microsoft 365, you can manage user photos in Microsoft Graph PowerShell. For instructions, see Manage user photos in Microsoft Graph PowerShell.
Quick start script
# Remove-UserPhoto — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org
# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-UserPhoto
$before | Format-List
# 3. Make the change (dry run first)
Remove-UserPhoto -Identity <MailboxIdParameter> -ClearMailboxPhotoRecord <SwitchParameter> -WhatIf
Remove-UserPhoto -Identity <MailboxIdParameter> -ClearMailboxPhotoRecord <SwitchParameter>
# 4. Verify and diff
$after = Get-UserPhoto
Compare-Object ($before | Out-String) ($after | Out-String)
Syntax — 2 parameter sets
Identity
Remove-UserPhoto [-Identity] <MailboxIdParameter>
[-Confirm]
[-DomainController <Fqdn>]
[-IgnoreDefaultScope]
[-WhatIf]
[<CommonParameters>]
ClearMailboxPhoto
Remove-UserPhoto [-Identity] <MailboxIdParameter>
[-ClearMailboxPhotoRecord]
[-GroupMailbox]
[-PhotoType <String>]
[-Confirm]
[-DomainController <Fqdn>]
[-IgnoreDefaultScope]
[-WhatIf]
[<CommonParameters>]
Parameters (8)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.