Skip to main content

Notifications

Community site session details

Community site session details

Session Id : lkz7218KoKcPuELNyTxSFS
Power Automate - Building Flows
Answered

Solution for deleting a user with Power Automate

Like (0) ShareShare
ReportReport
Posted on 24 Feb 2021 14:33:01 by

Hello ,

 

I was wondering if there is way to automate the delete process of a user from the 365 environment using power Automate.

What our process is when someone leaves the company is to block sign in / remove him from all groups but keep the account active for 60 days and then delete that account . I was wondering if there is a way we can automate this using Power Automate. Any help I would truly appreciate. Thank you. 

 

  • QuintonR Profile Picture
    28 on 01 Nov 2023 at 21:08:31
    Re: Solution for deleting a user with Power Automate

    @Thanasis One way to delete a user from a Microsoft List using Power Automate is to create a flow asking for user input (ask for the employee's first and last name) and store that in a variable. Then, automate opening web browser tabs to the desired list URL where you can search the name (via the variable defined earlier in the flow), and if that name is found, have the flow use the UI to delete them from that list.

     

    This can be repeated if you have multiple lists that you want to remove somebody from.  

  • Sara16 Profile Picture
    17 on 08 Aug 2023 at 13:00:04
    Re: Solution for deleting a user with Power Automate

    Initially while posting a comment here, I had no idea on how to fill up those fields, but after exploring a lot found the way to fill it up and got fed up as I keep getting the error whatever I try- either invalid or insufficient privileges, while I am the global admin as I am using my test tenant account.

  • Steve-CSSS Profile Picture
    4 on 07 Aug 2023 at 22:26:00
    Re: Solution for deleting a user with Power Automate

    @Sara16 you will need to configure those yourself.  This is a good link describing how to How To Setup MS Graph API Authentication For Power Automate (zeitgeistcode.com).  Hope that helps. I usually put the ClientID, Secret, and Tenant in Variables at the beginning of the flow so that it's easy to maintain.

  • Sara16 Profile Picture
    17 on 27 Jul 2023 at 13:19:49
    Re: Solution for deleting a user with Power Automate

    @shavora Can you please provide the whole screenshot to know what values to be passed for the remaining fields of this 'HTTP'??

     

  • Thanasis Profile Picture
    on 23 Mar 2022 at 19:55:14
    Re: Solution for deleting a user with Power Automate

    @shavora  Thank you so much for that 

  • Verified answer
    Gyllentid Profile Picture
    892 on 23 Mar 2022 at 19:10:15
    Re: Solution for deleting a user with Power Automate

    @Thanasis I am not sure you need to create a Sharpoint list for the functionality to work like you want. I am not sure why it's necessary. You can assign a user a security group with no permissions in Office 364 as well as assign them to an Azure ad group with no license attached. Those two things you can do from power automate. With or without a sharepoint list, that's possible, but a Sharepoint list can make it easier to track it, assign status start and end and be able to delete them from those criteria.

     

    With this function you can disable an azure user:

    Screenshot 2022-03-23 at 20.01.21.png

  • Thanasis Profile Picture
    on 23 Mar 2022 at 18:58:23
    Re: Solution for deleting a user with Power Automate

    @shavora  can you give me an example if you can. what would I use from the power automate to disable the user ?

    Do you think what @Schotty  suggested before would work?

  • Gyllentid Profile Picture
    892 on 23 Mar 2022 at 18:53:34
    Re: Solution for deleting a user with Power Automate

    @Thanasis Can you create an AD group with no rights to place them in? This you can do from power automate. You can also disable Azure users from power automate. Not sure these ideas meet your reqiurements though. I misread that t wasn't deleting you needed.

  • Thanasis Profile Picture
    on 23 Mar 2022 at 18:35:55
    Re: Solution for deleting a user with Power Automate

    @shavora That is great. Can I ask one more thing. What do I need to do if I want to disable and not delete ? 

  • Gyllentid Profile Picture
    892 on 23 Mar 2022 at 18:29:20
    Re: Solution for deleting a user with Power Automate

    @Thanasis If you mean the Azure user/license, you can delete a user with HTTP with calling graph.microsoft.com

     

    Screenshot 2022-03-23 at 19.14.48.png

     

    Though you will need to:

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 87

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 70 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 48 Super User 2025 Season 1

Overall leaderboard
Loading started