jpmoriarty
01-27-2003, 02:30 PM
I've got script ...
<%
Dim Dom
Dim Group
Dim Member
Dim strOutput
strDomainName="bedgebury.sch"
strGroupName="Staff"
Set Domain = GetObject("WinNT://" & strDomainName)
Set Group = GetObject("WinNT://" & strDomainName & "/" & strGroupName)
For Each Member in Group.Members
strOutput=Null
If (Left(Member.Parent,8) = "WinNT://") then
strOutput = Member.name
Elseif Left(Member.Parent,7) = "LDAP://" then
strOutput = strOutput & Domain.Name & "," & GroupName & "," &_
Mid(Member.Parent,8,Len(Member.Parent)-7) &_
"\" & Member.Name &"," & Member.Class
Elseif (Left(Member.Parent,8) = Null) then
strOutput = strOutput & Domain.Name & "," & GroupName & "," &_
Member.Name &"," & Member.Class
End If
response.write "<p>" & strOutput & "</p>"
Next
%>
that goes in and gives me a list of all the users in an active directory i've got. Fantastic! THe only problem is, I only know how to get to member.name and member.class. Is there a listing somewhere of all the other elements? For example, I'd like to extract First name and last name, telephone number etc etc.
Can that sort of thing be done in this way or is it back to the drawing board?
<%
Dim Dom
Dim Group
Dim Member
Dim strOutput
strDomainName="bedgebury.sch"
strGroupName="Staff"
Set Domain = GetObject("WinNT://" & strDomainName)
Set Group = GetObject("WinNT://" & strDomainName & "/" & strGroupName)
For Each Member in Group.Members
strOutput=Null
If (Left(Member.Parent,8) = "WinNT://") then
strOutput = Member.name
Elseif Left(Member.Parent,7) = "LDAP://" then
strOutput = strOutput & Domain.Name & "," & GroupName & "," &_
Mid(Member.Parent,8,Len(Member.Parent)-7) &_
"\" & Member.Name &"," & Member.Class
Elseif (Left(Member.Parent,8) = Null) then
strOutput = strOutput & Domain.Name & "," & GroupName & "," &_
Member.Name &"," & Member.Class
End If
response.write "<p>" & strOutput & "</p>"
Next
%>
that goes in and gives me a list of all the users in an active directory i've got. Fantastic! THe only problem is, I only know how to get to member.name and member.class. Is there a listing somewhere of all the other elements? For example, I'd like to extract First name and last name, telephone number etc etc.
Can that sort of thing be done in this way or is it back to the drawing board?