Can we update the sponsors of guest users in bulk via PowerShell script or Graph API? If yes then how to get it done?

Vinod Survase 4,786 Reputation points
2023-12-19T07:17:19.92+00:00

Can we update the sponsors of guest users in bulk via PowerShell script or Graph API? If yes then how to get it done?

For example: There is user with UPN ******@abc.com who was invited by internal user ******@jkl.com to the tenant from Teams or any other way and now we found that but we wanted to update the sponsor for guest user lifecycle in the tenant so we know who is the one who invited that guest user and who to reach in case we have to for clean-up and revoking required given accesses for them.

Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Danstan Onyango 3,906 Reputation points Microsoft Employee
    2023-12-22T07:20:11.3733333+00:00

    Yes. This is possible. Add sponsor

    POST https://graph.microsoft.com/beta/users/d8ab5060-f636-4cff-ae97-d4687f5c83f3/sponsors/$ref
    Content-Type: application/json
    
    {
      "@odata.id": "https://graph.microsoft.com/beta/users/{user-id}"
    }
    

    Note that this is a beta API. Also the endpoint requires the permission User.ReadWrite.All as least privileged permission so careful with that


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.