Deprovision users from all Active Directory groups on schedule

Recipe ToolsMarketingDirectory Services

What it does

When a scheduled time arrives, this automation searches Active Directory for users. It removes each user from every group they belong to, and the changes take effect right away.

Who it's for

IT teams who need to remove users from all Active Directory groups automatically on a recurring basis.

How teams use this

Deprovision offboarded users automatically

Run this automation on a schedule to remove departing employees from all Active Directory groups without manual steps. IT teams stay on top of access removal without opening Active Directory.

Clean up contractor access on expiration

Set the schedule to match contract end dates so contractors lose all group memberships at the right time. Only the user list changes between different contractor cohorts.

Filter users by department before removal

Add a condition to the search so only users from a specific department are removed from groups. This requires a department field check in the Active Directory query.

Exclude certain groups from removal

Set up a list of groups that should never lose members, and skip those during the loop. This requires a condition to check each group name against the exclusion list.

How it works

  1. Run on a set schedule. This automation runs every 5 minutes to check for users that need to be removed from all their Active Directory groups.
  2. Search for users in Active Directory. Query Active Directory to find the users who should be removed from all groups. The search returns a list of user objects to process.
  3. Remove each user from every group. For each user found, loop through all groups they belong to and remove them from Active Directory one by one. Membership changes take effect immediately.