Page 1 of 1 1
Topic Options
#154394 - 2006-01-01 07:42 PM InGroup()/EnumGroup() Bug?
Dmitry_F Offline
Lurker

Registered: 2006-01-01
Posts: 3
When testing Kix 4.51(also tried 4.52beta) i've discovered unexpected behaivour for InGroup()/EnumGroup(). The problem is i have Distribution (not security) groups in my W2k3 domain. Ingroup() returns false checking group membership for this groups, enumgroup() does not list them at all, moreover, group-membership cache is not reflecting this type of group membership. I've run comparable simple vb code to check group membership (see below) and got those groups listed, so I suppose there is a bug (or feature?))) in Kixtart? The side effect is if you later convert your distribution group to security one, you'll still get missing membership. If you create your group as security - no problem arrives, kixtart correctly reflects membership. Even afetr converting it to distribution and back. Converting security group to distribution raises the bug, converting back - eliminates bug. I suppose there is an AD attribute of this type of group being incorrectly filtered out. But better to have a bitmapped flag in InGroup()/EnumGroup() functions to be able to filter out distribution group membership.

Sample vb code (it works perfect -- but not kixtart):

On Error Resume Next
Const E_ADS_PROPERTY_NOT_FOUND = &h8000500D
Set objOU = GetObject("LDAP://cn=Users,dc=test,dc=com")

ObjOU.Filter= Array("user")

For Each objUser in objOU
WScript.Echo objUser.cn & " is a member of: "
WScript.Echo vbTab & "Primary Group ID: " & objUser.Get("primaryGroupID")

arrMemberOf = objUser.GetEx("memberOf")

If Err.Number <> E_ADS_PROPERTY_NOT_FOUND Then
For Each Group in arrMemberOf
WScript.Echo vbTab & Group
Next
Else
WScript.Echo vbTab & "memberOf attribute is not set"
Err.Clear
End If
Wscript.Echo
Next


Edited by Dmitry_F (2006-01-01 07:48 PM)

Top
#154395 - 2006-01-01 08:50 PM Re: InGroup()/EnumGroup() Bug?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
This is not a bug. Group membership is only checked on Security Groups period. Converting, renaming does nothing as the underlying SID remains the same on all objects for life once created.

The use of Distribution Groups is for Exchange. You can not set ACL permissions on a Distribution group, you must use a Security Group.

Top
#154396 - 2006-01-04 12:36 PM Re: InGroup()/EnumGroup() Bug?
Dmitry_F Offline
Lurker

Registered: 2006-01-01
Posts: 3
You didn't get. I create Distribution group. Later I convert it to security. Clear SIDs cache on workstation. Run InGroup. Should I get membership? I think - yes. Do I? NO!!!
Top
#154397 - 2006-01-04 12:38 PM Re: InGroup()/EnumGroup() Bug?
Dmitry_F Offline
Lurker

Registered: 2006-01-01
Posts: 3
Another idea is to add ability to InGroup to list Distribution groups membership also. As the code sample in vbasic above does - this is very useful.
Top
#154398 - 2006-01-04 02:23 PM Re: InGroup()/EnumGroup() Bug?
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
I think that the Group functions don't work with Universal groups either. I would also like to see them expanded to check computer group membership.

In the mean time, you can use fnInGroupAD() in the UDF library to check for membership of distribution groups (and computer group memberships).

Top
Page 1 of 1 1


Moderator:  ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.055 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.