web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : QwWh5zAtB57fBSKkKZrFUI
Power Automate - General Discussion
Answered

Disable AD account

Like (0) ShareShare
ReportReport
Posted on 27 Oct 2021 15:24:56 by 19

I want to update a user for disabled his account.

 

Rifton007_0-1635348249731.png

 

But this action doesn't work, it returns me "Forbbiden" and I'm full admin

 

{"error":{"code":"Authorization_RequestDenied","message":"Insufficient privileges to complete the operation."}

Thanks!

Categories:
I have the same question (0)
  • Verified answer
    Ellis Karim Profile Picture
    11,464 Super User 2025 Season 2 on 28 Oct 2021 at 19:39:39
    Re: Disable AD account

    This definitely looks like a permission issue. When you say you are full admin, is that Global Admin?

    2021-10-28_20-31-39.png

    I think you need at least the User Administrator role:

     

    2021-10-28_20-35-19.png


    Ellis

     


    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • freddo Profile Picture
    15 on 18 Nov 2022 at 17:39:36
    Re: Disable AD account

    not working for me. Tested with Global admin (& user adminstrator)

  • Ellis Karim Profile Picture
    11,464 Super User 2025 Season 2 on 19 Nov 2022 at 10:38:21
    Re: Disable AD account

    Hi @freddo ,

     

    Here is the output of the flow running again, with an admin role and as a standard user with no admin roles:

    Snag_134918aa.png

    Please post an extract of the flow and error message you are getting. Please also try with a new connection:

    Snag_1342bb36.png

    Ellis

  • jordanmastel Profile Picture
    28 on 30 Jul 2023 at 02:46:37
    Re: Disable AD account

    Hello,

     

    I am having this problem with an account that has User administrator permissions, I also tried with an account that has global administrator permissions. The account I am trying to disable has an administrator role.

     

    After removing the Azure AD admin role from the account I am trying to disable, the issue immediately goes away. I tried creating a new connection. I also tried to remove the role first before disabling it with a separate action but I get a 403 forbidden error there as well.

     

    Is disabling (accountEnabled = no) on Admin users with Update User in Power Automate not supported? Is there a workaround? I am trying to use Power Automate to automate disabling of accounts that are not used/renewed after a period of time.

  • Ellis Karim Profile Picture
    11,464 Super User 2025 Season 2 on 30 Jul 2023 at 12:04:38
    Re: Disable AD account

    User Administrator allows you to disable or enable SOME user accounts. As far as I know,  you can't disable accounts that have the Global Administrator role if the account you are using only has the User Administrator role:

    Azure AD built-in roles - Microsoft Entra | Microsoft Learn

     

    ekarim2020_0-1690718632558.png

     

     
    Ellis
    ____________________________________
    If I have answered your question, please mark the post as ☑️ Solved.
    If you like my response, please give it a Thumbs Up.
    My Blog Site

     

  • jordanmastel Profile Picture
    28 on 31 Jul 2023 at 02:26:34
    Re: Disable AD account

    Hey Ellis,

     

    The user account running the flow and the connection has Privileged Authentication Administrator, Privileged Role Administrator, and User Administrator.

     

    The account I am trying to disable has Azure AD Joined Device Local Administrator and Intune Administrator.

     

    Continues to fail due to "Insufficient privileges to complete the operation".

     

    I was able to work around this by using an app registration and an HTTP API patch action.

    jordanmastel_0-1690770377423.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 788 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 452 Moderator

#3
developerAJ Profile Picture

developerAJ 302

Last 30 days Overall leaderboard