ENTRA.UA.1014 - All users should have a sponsor set
All users should have a sponsor set
Description
All users should specify a sponsor for accountability and reference. This is often used for contract or external resources.
How to fix
Confirm with HR the correct sponsor.
Then run:
# Build the request body for the POST operation
$Body = @{
'@odata.id' = "https://graph.microsoft.com/v1.0/users/SPONSORID"
}
# Create the sponsor reference URI for the user
$Uri = "https://graph.microsoft.com/v1.0/users/USERID/sponsors/`$ref"
# Update sponsor
Invoke-MgGraphRequest -Uri $Uri -Method POST -Body $Body