# Create a rule to delete inactive users in Auth0

**URL:** <https://community.auth0.com/t/create-a-rule-to-delete-inactive-users-in-auth0/108365>\
**Category:** Get Help\
**Tags:** user-import-export, user-management\
**Created:** [June 1, 2023, 9:44pm UTC](https://community.auth0.com/t/create-a-rule-to-delete-inactive-users-in-auth0/108365 "2023-06-01T21:44:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkim](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@dkim](https://community.auth0.com/u/dkim)\
**Post date:** [June 1, 2023, 9:44pm UTC](https://community.auth0.com/t/create-a-rule-to-delete-inactive-users-in-auth0/108365/1 "2023-06-01T21:44:40Z")

</div>

Is is possible to create a rule that can delete the inactive users in Auth0, who aren’t included in Windows AD? AD and Auth0 do not seem to be synced when user from AD is deleted.

---

<div class="post-metadata">

**Author:** ![sean.mccamphill](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sean.mccamphill/32/47723_2.png) [@sean.mccamphill](https://community.auth0.com/u/sean.mccamphill)\
**Post date:** [June 2, 2023, 8:44am UTC](https://community.auth0.com/t/create-a-rule-to-delete-inactive-users-in-auth0/108365/2 "2023-06-02T08:44:22Z")

</div>

Hi @dkim - Auth0 rules are used in our authentication pipeline to help add functionality and create the extensible Auth0 pipeline so unfortunately it is not possible to create rule to delete users automatically.

[This post](https://community.auth0.com/t/how-to-automate-user-delete/61936/2) talks to how this could be scripted if that’s suitable for your use.

Thanks!

Seán

---

<div class="post-metadata">

**Author:** ![dkim](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@dkim](https://community.auth0.com/u/dkim)\
**Post date:** [June 2, 2023, 3:49pm UTC](https://community.auth0.com/t/create-a-rule-to-delete-inactive-users-in-auth0/108365/3 "2023-06-02T15:49:34Z")

</div>

Hi @sean.mccamphill,  
So are you saying that creating an API program is the best possible way for now to sync the number of users?  
No other method like importing the users will not work too?  
Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 16, 2023, 3:49pm UTC](https://community.auth0.com/t/create-a-rule-to-delete-inactive-users-in-auth0/108365/4 "2023-06-16T15:49:44Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
