WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADSI
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Three Ways a User is Part of a Group in AD

 Keywords: ADSI AD User Member Group Active Directory Primary Direct Indirect memberOf Property dsGetProperty dsGetUsersGrps

The following is based on the assumption that you are using the ADSI extender to access Active Directory.
  1. Primary Group membership. Use dsGetPrimGrp.
  2. Direct Membership. Use dsGetProperty function to get the values of the 'memberOf' property.
  3. Indirect Membership. Use dsGetUsersGrps.
There three ways a user is part of a group in AD. The first is the primary group which can be ignored for the moment.

The second is direct membership. These are the groups that are listed in the 'memberOf' property of an AD user object. There is no need to use the dsGetUsersGps function, if you are only interested in a user's direct group membership. You simply need to use the 'dsGetProperty' function to get the values of the 'memberOf' property.

The third way is indirect membership. Indirect membership is the result of a user being a member of a group that is itself a member of another group. As you might imagine this kind of membership can very quickly become convoluted and is the reason the dsGetUsersGrps function is part of the extender.

For example, given user 'x' and groups 'a', 'b' and 'c'.

If group 'a' is a member of group 'b', group 'b' is a member of group 'c' and user 'x' is a member of group 'a' then user 'x' is a member of group 'a' and an indirect member of both 'b' and 'c'. The 'dsGetUsersGrps' function will return all three groups plus the primary group. The 'memberOf' property would only return group 'a' in this example.


Article ID:   W17537
Filename:   Three Ways a User is Part of a Group in AD.txt
File Created: 2013:01:08:08:56:08
Last Updated: 2013:01:08:08:56:08