What are the differences between these types of NT groups?
- From: "gimme_this_gimme_that@xxxxxxxxx" <gimme_this_gimme_that@xxxxxxxxx>
- Date: Fri, 20 Mar 2009 19:43:49 -0700 (PDT)
Here is an exerpt from some code that goes through a set of users and
writes their AD group membership to a database table.
Note that either "1:" or "2:" is pre appended to the name that gets
added to the objList dictionary object (which is later saved in the
database)
What is the difference between the groups that start with "1:" and
"2:"?
Thanks.
Set objList = CreateObject("Scripting.Dictionary")
objList.CompareMode = vbTextCompare
Public Function GetGroups(objMember)
'On Error Resume Next
objList.RemoveAll
Call EnumGroups(objMember)
Set GetGroups = objList
End Function
Public Sub EnumGroups(objMember)
' Recursive subroutine to retrieve group memberships.
Dim arrGroups, strGroup, objGroup
arrGroups = objMember.memberOf
If IsEmpty(arrGroups) Then
' Do nothing.
ElseIf (TypeName(arrGroups) = "String") Then
Set objGroup = GetObject("LDAP://" & arrGroups)
If Not objList.Exists(objGroup.sAMAccountName) Then
objList.Add "1:" & objGroup.sAMAccountName , True
Call EnumGroups(objGroup)
End If
Else
For Each strGroup In arrGroups
Set objGroup = GetObject("LDAP://" & strGroup)
If Not objList.Exists(objGroup.sAMAccountName) Then
objList.Add "2:" & objGroup.sAMAccountName , True
Call EnumGroups(objGroup)
End If
Next
End If
End Sub
.
- Follow-Ups:
- Re: What are the differences between these types of NT groups?
- From: Richard Mueller [MVP]
- Re: What are the differences between these types of NT groups?
- Prev by Date: Difference between a domain group and a local group
- Next by Date: Re: problem with running script remotely - ODBC connection - ORACLE DB
- Previous by thread: Difference between a domain group and a local group
- Next by thread: Re: What are the differences between these types of NT groups?
- Index(es):
Relevant Pages
|