r/GraphAPI • u/Funkenzutzler • May 05 '25
Unable to set deleteBlocked via Graph or MgGraph SDK - regression or intentional deprecation?
Hi all,
I'm trying to programmatically protect an Azure AD security group from accidental deletion by setting the deleteBlocked property via Microsoft Graph.
No matter what I try, I always get 404 Not Found. Here's the context:
Group created via:
New-MgGroup -DisplayName "TestGroup" `
-MailEnabled:$false `
-MailNickname "testgroupxyz" `
-SecurityEnabled:$true `
-GroupTypes @()Not mail-enabled
Not
isAssignableToRole = trueNot part of an RMAU
resourceProvisioningOptionsis emptyCreated in a clean tenant (not bound to Intune, Teams, etc.)
Permissions:
Auth via Connect-MgGraph -Scopes "Group.ReadWrite.All"
Using either
Update-MgGrouporInvoke-MgGraphRequest
Both fail:
Update-MgGroup -GroupId $id -AdditionalProperties @{ deleteBlocked = $true }or
Invoke-MgGraphRequest -Method PATCH `
-Uri "https://graph.microsoft.com/v1.0/groups/$id"` `
-Body @{ deleteBlocked = $true }→ returns:
404 Not Found – Resource '' does not exist...Even though:
Get-MgGroup -GroupId $idworks perfectly, and returns a valid group object.
So... was this feature deprecated?
This used to work (e.g. via Azure AD Graph or MSOnline in the past), and I’ve seen it set on tenant-internal groups (deleteBlocked: true in Graph output). But nothing works anymore - not on new groups, not even with Global Admin permissions (tested via portal as well).
Is this property no longer writeable via Microsoft Graph?
Is this an intentional restriction (e.g. since AzureAD → Entra migration)?
Or a regression / unannounced change?
If you’ve successfully set deleteBlocked recently - or have internal docs or workarounds - I’d love to hear it.
Thanks!