cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Thanasis
Helper IV
Helper IV

Solution for deleting a user with Power Automate

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. 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
alrez
Community Support
Community Support

Hi,

 

Looking at our documentation I don't see anyway to delete users through Power Automate. I don't believe it possible to delete users using any built in functions of Power Automate. It looks like there is already a suggestion to add this functionality in. https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Azure-AD-remove-User/idi-p/102139

 

Regards,

 

Alex

 

-------

 

Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@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

View solution in original post

9 REPLIES 9
alrez
Community Support
Community Support

Hi,

 

Looking at our documentation I don't see anyway to delete users through Power Automate. I don't believe it possible to delete users using any built in functions of Power Automate. It looks like there is already a suggestion to add this functionality in. https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Azure-AD-remove-User/idi-p/102139

 

Regards,

 

Alex

 

-------

 

Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanasis
Helper IV
Helper IV

Hello Thank you @alrez  for your response. One last thing , do you know if at least there is away to get a notification using flow or something else when a user has been disabled for at lets say 60 days ?

Hi Thanasis,
I'm in the process of setting this up and I'm creating a SharePoint Off-boarding list and adding in Name, last day and last day +14 as the columns. I add the off-boarded user to a group with a basic license instead of a premium license.
This way, after 14 days, I can remove the Out of Office and removing their basic license and a few other things and that flow will run every day, and notify me through Teams that xyz offboarded user left 2 weeks ago so manually delete the user.

shavora
Post Prodigy
Post Prodigy

@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:

Thanasis
Helper IV
Helper IV

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

@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
Helper IV
Helper IV

@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?

@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
Helper IV
Helper IV

@shavora  Thank you so much for that 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,710)