Block Profile Picture Updates
Look up the recovered Graph settings for restricting profile-photo updates through Microsoft 365 web portals. The notes include a retired mailbox-policy method and incomplete command fragments, not a validated configuration procedure.
Source-derived reference
These notes were recovered from OneNote. Configuration, permissions and operating results have not been freshly verified. Confirm the applicable authority and environment before acting.
Source ticket: https://servicedesk.ccmschools.app/helpdesk/tickets/119490
Retired method: Exchange mailbox policy
This exchange policy has been retired and no longer works. To View Mailbox Policy Setting:
Get-OwaMailboxPolicy | FL nam, SetPhotoEnabled
Screenshot retained for review
Web photo-update settings described in the source
This is for restricting users from updating their user profile photos using M365 web portals.
These were the remaining locations where a user can update their profile picture
- myaccount.microsoft.com/organizations?ref=AccountSettings - m365.cloud.microsoft/search/overview
View Current Photo Update Restriction Settings For Your M365 Tenant
The source records the tenant settings as being in their default state at the time of capture.
In the default state everyone can manage their profile picture.
The held screenshot was described as showing those default settings.
- source = $null
- allowedRoles = empty list
Connect-MgGraph
Invoke-MgGraphRequest -Method GET -Uri "https://graph.microsoft.com/beta/admin/people/photoupdatesettings"
Screenshot of result
Screenshot retained for review
TO RESTRICT profile photoupdate
The source records this script location; the script itself is not supplied by that path in this companion:
…\Documents\powershell\R&DTempScripts\ProfilePhotoRestrictAccess\ProfilePhotoRestrictAccess.ps1
TO RESTRICT profile photo updates via the M365 website, you need to run the following patch command.
The GUIDs in the allowedRoles are for the User Administrator and Global Administrator.
Note if you don't add the GA role to the allowedRoles, GA's will not be able to update a profile picture using the web interface.
Screenshot retained for review
Role Id for
- People Administrator: 024906de-61e5-49c8-8572-40335f1e0e10
- User Administrator: fe930be7-5e62-47db-91af-98c3a49a38b1
- Global Administrator: 62e90394-69f5-4237-9190-012177145e10
Role Id's are from learn.microsoft.com
MS Graph Scope Required: PeopleSettings.ReadWrite.All
Connect-MsGraph -Scope "PeopleSettings.ReadWrite.All"
$URI = " https://graph.microsoft.com/beta/admin/people/photoupdatesettings"
$METHOD = "PATCH"
$ApiParams = @{
"source" = "cloud"
"allowedRoles" = @("024906de-61e5-49c8-8572-40335f1e0e10","fe930be7-5e62-47db-91af-98c3a49a38b1","62e90394-69f5-4237-9190-012177145e10")
}
Invoke-MgGraphRequest -Method $METHOD -Uri $URI -Body $ApiParams
TO REVERSE RESTRICTION AND ALLOW ALL USERS AGAIN:
$URI = " https://graph.microsoft.com/beta/admin/people/photoupdatesettings"
$METHOD = "PATCH"
$UndoApiParams = '{
"allowedRoles": []
}'
$Settings = Invoke-MgGraphrequest -Uri $URI -Method $METHOD -Body $UndoApiParams
===================END: RESTRICTING WEB FOR PHOTO UPDATES =============================
Photos can also be updated using powershell and admin consoles.
Users in the following roles can make photo profile changes:
- People Administrator (New as of 6Feb2025 - office365itpros.com)
- Directory writers
- Intune administrator
- User administrator
Powershell Using Ms Graph commandlets
- Change user profile photo - Microsoft 365 admin | Microsoft Learn
- Scopes required to update
- Users Only: "User.ReadWrite.All"
- M365 Groups Only: "Group.ReadWrite.All"
- If you need to update profile photos of groups and users then add both scopes when connect to M365 via MS Graph.
References
Exchange Photo commandlets were retired in 2023.
- Deprecation of Exchange Online PowerShell UserPhoto cmdlets | Microsoft Community Hub
- Same page... table of the replacement Graph command and required permissions.
More Detailed List of Command for managing user profile Photos:
- Change user profile photo - Microsoft 365 admin | Microsoft Learn
- M365 Role Id List: https://learn.microsoft.com/en-us/entra/identity/role-based-access-control/permissions-reference
Code for setting profile photo tenant wide policy update:
- (Best Resource!) How to control profile photo updates in Microsoft 365 via the photoUpdateSettings control - Blog - [www.michev.info](https://www.michev.info/)
- Microsoft 365 Photo Update Settings Policy - office365itpros.com
- How to Figure Out What Microsoft Graph Permissions You Need | Practical365 - practical365.com