Ahhh...yes, I understand.
Actually the user is a member of Domain Users...but he's still not showing up. When I grab a FindAll() of that CN, the searcher comes back empty each time.
Main Topics
Browse All TopicsI'm using a directory entry and directory search combination to retrieve all the groups/users from an AD domain.
Right now I'm able to get all the groups then use those group CN's to get all the users within. However, I can't manage to retrieve the users not currently assigned into an active directory group!
By what means would I go about fetching these users?
Here's what I'm doing right now to get the users contained within the groups.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
How do you search and get AD users, Are you using LDAP?? or something else??
Are you search in the default location Users default container or an OU created by you or the administrator? Actually, I just want to make sure that you in case of containers you write CN but in case of Organization Units you write OU.
HI there,
This is a feature of ADSI. If you enumerate a user's group memberships, you will notice that it doesn't return Domain Users as a group, even though the user is a member. Similarly, if you enumerate members of Domain Users, it will not return every user.
memberof on a user, and member on a group are linked attributes. The primary attribute is member on the group, meaning that you can only edit this, and then the system updates the relevant user objects accordingly.
The reason for this is that Domain Users is the primary group by default. A user's primary group is not included in the 'memberof' attribute, meaning that it cannot be in 'member' in the corresponding group. This group is stored in the primary group ID attribute on the user object (primaryGroupID).
So that's why the search on Domain Users is coming back blank! This is by design.
So.... all users will be in at least one group, but if they are just in one group, then querying member or memberof will not yield what you want. I think it best to just exclude Domain Users from your report (as everyone is a member anyway) and you can use the following LDAP filter to get any user in NO OTHER groups:
(&(objectClass=user
I'
Tony
Business Accounts
Answer for Membership
by: Sherif_TalaatPosted on 2009-08-07 at 15:19:51ID: 25047352
Hi,
You will not be able to get those users whom not members in any groups. Simply, the user must be at least member in the default group in AD "Domain Users" group in order to be able to login to his computer, server, printers, and access other resources.
Maybe you can have user with no group assigned but this user will not be able to do anything even just login. So, it doesn't make a sense to have user with no group at least one group.