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 Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
{count} vote

Accepted answer
  1. VipulSparsh-MSFT 16,311 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.