Solved

List AD groups that contain nested groups

Posted on 2010-11-23
6
816 Views
Last Modified: 2012-05-10
Need a script to list only the AD groups that contain groups.  Would like to have an option to include or exclude listing all group members.  Output needs to show full AD path where the main group and nested groups are located.

Thanks
0
Comment
Question by:Carl Webster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 27

Expert Comment

by:KenMcF
ID: 34198886
If you are able to use the quest cmdlets from your other question you can try this

to get group memebrs you can add this

get-qadgroupmember $g | select name
$groups = get-qadgroup -searchroot "OU=Groups,dc=Domain,dc=Local" | where{$_.memberof -ne ""} 
foreach ($Group in $Groups){
write-host $group.name
$grp = get-qadmemberof $Group
foreach ($g in $grp){
write-host `t $g.dn
}}

Open in new window

0
 
LVL 4

Expert Comment

by:Vishal Patel
ID: 34204107
You can use AD Manager Plus (A ManageEngine tool, free to try) for the purpose.
0
 
LVL 36

Author Comment

by:Carl Webster
ID: 34232373
I am now on this network and it is a 2000 AD system and all the DCs are running 2000 SP4.

Anyone have a VBScript I could use to list which of their 416 AD groups contain groups?
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 27

Accepted Solution

by:
KenMcF earned 500 total points
ID: 34232490
I do nopt have a vbscript but could create one if needed later.
You could try to use ADFind or just a query in ADUC

(&(objectcategory=group)(memberof=*))

adfind -default -f "&(objectcategory=group)(memberof=*)" dn

you could also get the members from ADFind or you could output the list from ADFInd to a test and use vbscript to get all the members

http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/usersgroups/groups/#EnumGroupmembership.htm
0
 
LVL 36

Author Comment

by:Carl Webster
ID: 34232582
I can't find out how in 2000's ADUC how to do a search to list only groups that contain groups.

I was able to use ADFind to list all the groups.  ADFind says there are 479 groups and ADUC says there are 416.  I'll trust ADFind and Joe.

Just tried your ADFind line and it worked.  Gave me a list of 62 groups.  Let me verify a random sample.
0
 
LVL 36

Author Comment

by:Carl Webster
ID: 34232630
I guess this will work.  Your "adfind -default -f "&(objectcategory=group)(memberof=*)" dn" gives me a list of groups that contain groups or groups that are members of other groups.

i.e. Domain Admins contains other groups but GroupABC has no members but is a member of GroupXYZ.  WHen I look at GroupXYZ it shows GroupABC as a member.  

That should work for this purpose.

Thanks
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article runs through the process of deploying a single EXE application selectively to a group of user.
Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question