🎉 Our Microsoft 365 Reporting & Management Tool is now available in Azure Marketplace 🚀
This website uses cookies to improve your experience. We'll assume you're ok with this. Know more.
Active Directory

How to Get Active Directory Groups a User is Member Of

Active Directory groups, such as security and distribution groups, allow you to control resource access and send emails to a designated set of users. But what if any unwanted users are part of groups with access to important resources? In such cases, the risk of data leaks and security breaches is significant. This guide will walk you through the steps to get AD user group membership report and offer insights to help you manage them securely.

Active Directory Users and Computers

Active Directory Permission Required
Account Operators Least Privilege
Domain Administrators Most Privilege
  • Open the Active Directory Users and Computers (ADUC) console.
  • Click on the Action tab and select ‘Find’. From the ‘In’ field, choose the desired Domain, Organizational Unit (OU) where the user resides.
  • Enter the full or partial name of the user in the Name field and click ‘Find Now’.
  • From the search results, double-click the specific user account.
  • Then, hit on the Member Of tab to get a list of AD groups the user is a member of.
Active Directory Users and Computers
The Name column displays the names of the groups the user belongs to, while the Active Directory Domain Services Folder column shows the OU where the group resides.

Using PowerShell

Active Directory Permission Required
Account Operators Least Privilege
Domain Administrators Most Privilege
  • Ensure that the Active Directory PowerShell module is installed in your server.
  • Run the below cmdlet to get AD user group membership using PowerShell.
  • Windows PowerShell Windows PowerShell
     Get-ADPrincipalGroupMembership –Identity <DistinguishedName> | Select distinguishedName, GroupCategory, GroupScope, name| Format-Table
Using PowerShell
Note: You can also use GUID, security identifier (SID) or SAM account name to specify the identity.

The above cmdlet displays all the groups a user is member of along with their category, scope, distinguished name, etc.

AdminDroid Active Directory Reporter- Unlock Group Insights! Discover, Track, and Manage AD Users’ Group Membership with Ease.

The AdminDroid Active Directory Reporting tool provides insights into all groups a user is part of, which helps you to analyze and determine the resources they can access. Additionally, it provides essential information about those users and groups to simplify group membership management.

Find Users without ‘Domains Users’ as their Primary Groups

Identify users whose primary group is not 'Domain Users' to prevent potential issues with group policies that target 'Domain Users'.

Get Alerted on Group Membership Changes in Active Directory

AdminDroid allows you to generate alert on group membership changes in Active Directory to monitor unauthorized user additions and prevent them in future.

Get Users Assigned as Group Managers in Active Directory

Identify all group managers in Active Directory to ensure that only authorized users are assigned to manage groups.

Check AD Group Membership for Computers

Retrieve a list of AD computer group memberships to ensure each computer is assigned to the required group with appropriate security policies and updates.

Track Users with Permissions to Access AD Groups

Review the security permissions of Active Directory groups and their access levels to identify any unintended users have the rights to modify AD group memberships.

Find AD Users Distribution Group Memberships

Retrieve a list of AD distribution group members to confirm that only authorized users receive emails sent to distribution groups.

AdminDroid simplifies user and group administration by delivering detailed reports and audit events related to group memberships in Active Directory. With AdminDroid's advanced features integrated into these reports, you can stay informed of every change in your Active Directory environment.

Explore a full range of reporting options

Important Tips

Identify users who are only in their primary group and add them to the necessary groups for providing access to required folders, printers, etc...

Create nested groups in Active Directory to provide more granular access to resources in complex scenarios.

Find inactive users in Active Directory and remove their group memberships if access is no longer required.

Common Errors and Resolution Steps

The following are possible errors and troubleshooting hints while dealing with users’ group membership in Active Directory.

Error get-adprincipalgroupmembership : an unspecified error has occurred.

This error occurs when you try to fetch users’ group membership details from a remote server instead of DC.

Fix Run the cmdlet directly from the Domain Controller (DC). If you want to run it on a remote server, include the 'ResourceContextServer' parameter in the cmdlet.
Get-ADPrincipalGroupMembership -Identity <DistinguishedName> -ResourceContextServer <DomainName>

Error Active Directory set primary group greyed out.

This option is greyed out when you try to assign a domain-local scope group as the primary group for a user.

Fix Use a group with either global or universal scopes as the primary group, as domain local scope groups are not supported.

Error The primary group cannot be removed.

This error occurs when you try to remove a user from their primary group.

Fix Assign another group as primary one for the user before removing from their current primary group.
Frequently Asked Questions

Check Users’ AD Group Membership and Manage their Access Levels Effectively

1. How to find out which AD-group is granting a user access to a folder?

Active Directory security groups are used to control access to specific resources. Members within these groups can access network resources based on the permissions assigned to the group.

What if an unnoticed group membership grants a user access to a folder with sensitive information?

Identifying the AD group that grants access to a particular folder helps you to manage user access effectively by adding or removing them from the group.

Run the following PowerShell script to identify which AD group grants users access to a shared folder in Active Directory.

$userlist = Import-CSV -Path '<FileLocation>'
$folder = "<FolderPath>"
foreach ($user in $userlist) { 
    $username = $user.SamAccountName
    $groups = (Get-ADUser -Identity $username -Properties MemberOf).MemberOf |
              ForEach-Object { (Get-ADGroup $_).Name }
    $GroupsWithAccess = @()
    foreach ($group in $groups) {
        $acl = Get-ACL -Path $folder
        if ($acl.Access | Where-Object { $_.IdentityReference -match $group }) {
            $GroupsWithAccess += $group
        }
    }
    if ($GroupsWithAccess.Count -gt 0) {
        foreach ($GroupWithAccess in $GroupsWithAccess) {
            Write-Host "$user has access to the folder via Group '$GroupWithAccess'"
        }
    } else {
        Write-Host "$username does not have access to the folder via any group."
    }
}

Note: The CSV file should have a column named SamAccountName with the required names listed in each row.

user-file-access-via-group

2. How to get cross domain group membership of users in Active Directory?

In organizations with multiple domains, managing cross-domain access is essential, especially when users in Domain A need access to resources in Domain B. To provide access, users from Domain A are added to AD groups in Domain B, the resource domain. These groups manage permissions to resources (like shared folders or applications) specifically within Domain B.

Therefore, it is important to know your users' group memberships across other domains to ensure they have appropriate access to necessary resources.

Run the cmdlet below to get cross domain group membership of an AD user using PowerShell.

Get-ADPrincipalGroupMembership -Identity <DistinguishedName> -ResourceContextServer <ResourceDomainName> -ResourceContextPartition “DC=domainA,DC=com”
Note:
  • Replace Identity with the user's GUID, security identifier (SID), or SAM account name.
  • Replace ResourceDomainName with the domain name (e.g., contoso.com) where the resource is located.

3. How to get group memberships of multiple users in Active Directory?

If you’re part of a large organization, manually checking each user’s group details in the ADUC console can take significant time. However, using a simple PowerShell script, you can retrieve group memberships for multiple users without the need to locate each one individually.

Run the cmdlet below to fetch users from a CSV file and view the groups they can access.

$userlist = Import-CSV -Path '<FileLocation>''
foreach($user in $userlist){
    $username = $user.SamAccountName
    Write-host “$username is a member of the groups below.”
    Get-ADPrincipalGroupMembership -Identity $username -ResourceContextServer <DomainName> |
        Select name | 
        ft -hidetableheaders
}

Note: The CSV file should have a column named SamAccountName with the required names listed in each row.

group-membership-multiple-users

Get a detailed summary of AD users’ group membership using AdminDroid!

  • A centralized report that enables you to easily locate all users' group membership details in Active Directory.
  • Along with users' group membership details, this report displays their account status, OU name, department, job title, and more. This eliminates the need to navigate through multiple reports to gather each piece of information.
  • Leverage AdminDroid’s Schedule Report functionality to receive this centralized report in your Teams channels or mailboxes to track user memberships regularly.
user-membership-summary
Pro Tip: Click the group links in the Member Of column to view all groups a user belongs to in a single place.

4. How to check who added a user to a group in Active Directory?

Imagine someone accidentally adds an unauthorized user to the Domain Admins group. This grants them the same privileges as domain administrators and puts sensitive data at risk. Identifying who added users to a “Domain Admins” group allows you to analyze whether that user should have the privilege to add users to group. If not, you can alter the group’s security permissions to prevent them from adding users to the group.

Before you can audit changes in your Active Directory, you need to turn on auditing using the GPMC console. Once you’ve enabled auditing, follow the steps below to audit group membership changes in Active Directory using Event Viewer.

  • Open Server Manager, click on Tools and select ‘Event Viewer’.
  • Navigate to Windows logs»Security. From the right pane, click on Filter Current Log to filter only the required details.
  • Enter the distinguished name of the user in the User section. Use the following Event IDs to check the user membership changes according to the group scope type.
    • 4728: Indicates a member was added to a security-enabled global group.
    • 4732: Represents the addition of a member to a security-enabled local group.
    • 4756: Tracks the inclusion of a member in a security-enabled universal group.
  • After entering the desired event ID, click OK to display all related operations.
  • Now, double click on the desired event to view its properties. Here, you can use the following sections to get additional information on member addition activities.
    • Subject: Identifies who added the user to the group.
    • Member: Indicates the user who was added.
    • Group: Specifies the group to which the user was added.

Navigating through the event viewer can be time consuming as it requires you to remember and enter different event IDs for membership changes across various groups scope types.

With the Member Added to Groups report, you can audit the member additions of Active Directory groups with all scope types in a single place.

  • In this report, you can see detailed information on member additions that include Added Time, Group Name, Added Member, and Added By, etc.
  • You can use the Added By chart to identify who adds users to groups in Active Directory and limit the permissions of unwanted users.
member-added-to-groups

Kickstart Your Journey With
AdminDroid

Your Microsoft 365 Companion with Enormous Reporting Capabilities

Download Now
User Help Manuals Compliance Docs
x
Delivering Reports on Time
Want a desired Microsoft 365 reports every Monday morning? Ensure automated report distribution and timely delivery with AdminDroid's Scheduling to your email anytime you need.
Delivering Reports on Time
Schedule tailored reports to execute automatically at the time you set and deliver straight to the emails you choose. In addition, you can customize report columns and add inteligent filtering to the activities just from the previous day to suit your Microsoft 365 report requirements.
Set It, Schedule It, See Results- Your Reports, Your Way, On Your Time!
Time Saving
Automation
Customization
Intelligent Filtering
Give Just the Right Access to the Right People
Grant fine-tuned access to any Microsoft 365 user with AdminDroid’s Granular Delegation and meet your organization’s security and compliance requirements.
Give Just the Right Access to the Right People
Create custom roles loaded with just the right permissions and give access to admins or normal users within AdminDroid. The result? A streamlined Microsoft 365 management experience that aligns your organization's security protocols and saves your invaluable time and effort.
Align, Define, Simplify: AdminDroid's Granular Delegation
Smart Organizational Control
Effortless M365 Management
Simplified Access
Advanced Alerts at a Glance
Receive quick notifications for malicious Microsoft 365 activities. Engage with the AdminDroid’s real-time alert policies crafted to streamline your security investigations.
Advanced Alerts at a Glance
Stay informed of critical activities like suspicious emails and high-risk logins, bulk file sharing, etc. Through creating and validating ideal alert policies, AdminDroid provides a comprehensive approach to real-time monitoring and management of potential threats within your organization.
AdminDroid Keeps You Always Vigilant, Never Vulnerable!
Proactive Protection
Real-time Monitoring
Security Intelligence
Threat Detection
Merge the Required Data to One Place
Combine multiple required columns into one comprehensive report and prioritize the information that matters most to you with AdminDroid’s Advanced Column Customization.
Merge the Required Data to One Place
This column merging capability offers a flexible way to add different columns from various reports and collate all the essential data in one place. Want to revisit the customized report? Save it as a 'View’, and your unique report is ready whenever you need it.
Merge with Ease and Save as Views!
Custom Reporting
Unique View
Desired Columns
Easy Data Interpretation
Insightful Charts and Exclusive Dashboards
Get a quick and easy overview of your tenant's activity, identify potential problems, and take action to protect your data with AdminDroid’s Charts and Dashboards.
Insightful Charts and Exclusive Dashboards
With AdminDroid charts and dashboards, visualize your Microsoft 365 tenant in ways you've never thought possible. It's not just about viewing; it's about understanding, controlling, and transforming your Microsoft 365 environment.
Explore Your Microsoft 365 Tenant in a Whole New Way!
Executive overviews
Interactive insights
Decision-making
Data Visualization
Efficient Report Exporting for Microsoft 365
Downloading your reports in the right file format shouldn’t be a hassle with AdminDroid’s Report Export. Experience seamless report exporting in various formats that cater to your needs.
Efficient Report Exporting for Microsoft 365
Navigate through diverse options and export Microsoft 365 reports flawlessly in your desired file format. Tailor your reports precisely as you need them and save them directly to your computer.
Take Control, Customize and Deliver- Your Office 365 Data, Exported in Your Way!
Easy Export
Seamless Downloading
Data Control
Manage Microsoft 365

Get AdminDroid Office 365 Reporter Now!