I was asked during a job interview how I would clean up a messy Active Directory environment and determine which groups could be safely deleted without disrupting anything. They specifically pointed out that some groups might be empty but still referenced by applications or infrastructure.
My initial approach was to export all groups and document their OUs, GUIDs, members, descriptions, and other metadata. I would also inspect file-share ACLs, search configuration files and code repositories, review Microsoft 365 usage, and contact the relevant application or team owners. More recently, I was asked to review a list of groups and identify which ones were being used. Checking descriptions and file-share permissions helped, but there did not seem to be any universal indicator showing that a group was referenced somewhere.
For example, an application might query Active Directory for a user's group membership during sign-in and use that information for authorization. Does Active Directory record that kind of group usage anywhere? Is there a reliable way to discover applications, systems, or scripts that depend on a group, including empty groups, without relying on disruptive testing?
4 Answers
There are useful technical checks, but none of them covers every possible consumer. Search file-share and other ACLs by SID, inspect nested group membership, scan scripts and configuration repositories, review scheduled tasks and service accounts, and examine integrations such as VPN, proxy, SaaS, and application authorization settings. Also check for deleted-object SIDs in ACLs, since those often reveal old groups or missing ownership.
Empty groups deserve extra caution: an application may use the group name or object identifier even when it currently has no members. Conversely, a group with members may not be used anywhere. Membership and actual consumption are separate questions.
For cleanup, treat this as a risk-management and ownership problem rather than something AD can solve automatically. Record the group's purpose, owner, members, nested memberships, ACL references, application references, and last known activity. Ask an accountable business or system owner to confirm whether it is still needed, and have them test the relevant application where possible.
A common low-risk process is to remove stale memberships first, mark groups as deprecated, stop issuing new access, and keep them for a defined observation period. Some organizations temporarily rename or disable groups and watch for incidents before deletion, but that is a controlled disruption test, not a zero-impact guarantee. Groups with unknown ownership or legacy dependencies are usually safer to retain until someone can validate them.
You can improve visibility with auditing and centralized logging, but it still will not provide a complete answer. Security logs may show events such as logons, Kerberos ticket activity, LDAP queries, or directory changes, depending on what auditing is enabled. Some applications also log authorization checks. A SIEM can correlate those records, but many services do not identify the exact groups they evaluated, and rarely used groups may not appear during the observation period.
The practical approach is to build an inventory of group owners and consumers, inspect permissions and configurations, and monitor over a period that covers important business cycles. Even then, an occasional-use group can be missed.
I had mostly seen auditing used for membership changes, not for a reliable record of every time a group was consulted. That distinction seems important here.
There is no universal "in use" flag for an Active Directory group. AD provides identity, authentication, and directory data, but the individual services usually make their own authorization decisions. A file server, application, proxy, or network device may check group membership, but AD generally does not know what the service does with the result.
A service can receive group information in a Kerberos token, or query AD directly through LDAP. Those operations do not normally create an audit record saying, "this group was used by this application." To find dependencies, you have to inspect the systems that consume the groups: file and printer permissions, application configuration, scheduled tasks, scripts, network devices, cloud services, and identity integrations.
That was my concern too. The interview scenario sounded like they expected a way to identify even empty groups with zero risk, but I could not find a mechanism that could guarantee that.

That matches what I eventually concluded. A gradual deprecation process seems much more realistic than promising that every dependency can be discovered beforehand.