Graph API - Delete User from AD Premission

Shimon Zouzout 26 Reputation points
2021-01-31T08:46:06.357+00:00

Hi,

I wrote a Python program that needs to delete user from my AD. I was following this guide -> https://learn.microsoft.com/en-us/python/api/overview/azure/graph-rbac?view=azure-python
When I perform ("graphrbac_client.users.delete('xxxxxx') ") delete command I'm getting "Insufficient privileges to complete the operation."
Which https://graph.windows.net/ API permission my app needs to pass that? (Im allredy granted "Directory.ReadWrite.All" , "Directory.AccessAsUser.All" permissions.

Thank you!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,486 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,436 questions
{count} vote

Accepted answer
  1. VipulSparsh-MSFT 16,271 Reputation points Microsoft Employee
    2021-02-01T04:15:11.393+00:00

    @Shimon Zouzout Thanks for reaching out. If your application needs to call this action, without user interaction then you must have the following permission :
    User.ReadWrite.All Also note that this needs Admin consent

    62308-graphapi-permission.png

    -----------------------------------------------------------------------------------------------------------------

    If the suggested response helped you resolve your issue, please do not forget to accept the response as Answer and "Up-Vote" for the answer that helped you for benefit of the community.


0 additional answers

Sort by: Most helpful

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.