<% Const ADS_GROUP_TYPE_GLOBAL_GROUP = &H2 Const ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP = &H4 Const ADS_GROUP_TYPE_UNIVERSAL_GROUP = &H8 Const ADS_GROUP_TYPE_SECURITY_ENABLED = &H80000000 ADsDomain = Session("ADsDomain") 'Session may time out If ADsDomain = "" then ADsDomain = Application("ADsDomain") End if 'Parse the URL path into adsPath urlPath = Request.QueryString("anr") userID = Application("UserID") password = Application("Password") domainPath = "LDAP://" & ADsDomain counter = 0 idx = 1 adsPath = "" While idx <> 0 idx = InStr(1, urlPath, "%20") If (idx = 0) Then adsPath = adsPath & Mid(urlPath, 1) Else adsPath = adsPath & Mid(urlPath, 1, idx - 1) adsPath = adsPath & " " End If urlPath = Mid(urlPath, idx + 3) Wend Set dso = GetObject("LDAP:") if ( o.Class <> "group" ) then Set o = Nothing Set dso = Nothing Response.Redirect "person.asp?anr=" & Request.QueryString("anr") end if %> Group Information

banner.gif (3494 bytes)         search.gif (1222 bytes)

<% On Error Resume Next members = o.Get("member") groupType = o.Get("groupType") if ( groupType And ADS_GROUP_TYPE_SECURITY_ENABLED ) then groupDesc = "Security Group " else groupDesc = "Distribution List " end if if ( groupType And ADS_GROUP_TYPE_GLOBAL_GROUP ) Then groupDesc = groupDesc & "(Global)" ElseIf ( groupType And ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP ) Then groupDesc = groupDesc & "(Domain Local)" ElseIf ( groupType And ADS_GROUP_TYPE_UNIVERSAL_GROUP ) Then groupDesc = groupDesc & "(Universal)" end if 'Get the owner ownerPath = domainPath & "/" &o.Get("managedBy") if ( Err.Number = 0 ) then idxStart = InStr(1, ownerPath, "=") idxEnd = InStr(idxStart, ownerPath, ",") owner = Mid(ownerPath, idxStart+1, idxEnd - idxStart -1 ) end if %>
Group <%Response.Write o.Get("cn")%>
Group Type: <%Response.Write groupDesc%>
Owner: <%Response.Write owner%>

 

<% for each member in members 'Alternate background color for enhancing the appearance counter = counter + 1 md = counter mod 2 if ( md = 0 ) then bkColor = "#C9C9C9" else bkColor = "#E8E8E8" end if %> <% idxStart = InStr(1, member, "=") + 1 idxEnd = InStr(1, member, ",") rdnMember = Mid(member, idxStart, idxEnd - idxStart) refMember = domainPath & "/" & member %> <% Next %>
   Group Members
<%Response.Write rdnMember %>
<% if ( counter > 0 ) then Response.Write " Member count: " & counter &" user(s) and group(s)" else Response.Write "Do not have membership or permission to view" end if counter = 0 'Reset counter %> <% Set dso = Nothing Set o = Nothing Set mgr = Nothing %>

<% Response.Write "Query was executed in: " & elapse & " second(s)" Response.Write "
" elapse = Timer - t Response.Write "Total Time (Execute, Enumeration and Rendering): " & elapse & " second(s)" %>