VB script to get the group name's description in Active Directory
Posted on 2008-06-24
With the following code I can get the groups that belong to an OU. Now I would like to add some code to the one below so I can get the group's description. Any help will be very much appreciated.
strGroupDN = "GroupDN"
strSpaces = ""
set dicSeenGroupMember = CreateObject("Scripting.Dictionary")
DisplayMembers "LDAP://" & strGroupDN, strSpaces, dicSeenGroupMember
Function DisplayMembers (strGroupADsPath, strSpaces, dicSeenGroupMember)
set objGroup = GetObject(strGroupADsPath)
for each objMember In objGroup.Members
Wscript.Echo strSpaces & objMember.Name
if objMember.Class = "group" then
if dicSeenGroupMember.Exists(objMember.ADsPath) then
Wscript.Echo strSpaces & "already seen group member" & _
"(stopping to avoid loop)"
dicSeenGroupMember.Add objMember.ADsPath, 1
DisplayMembers objMember.ADsPath, strSpaces & " " , _