'This script queries active directory. 'The WinNT provider is for use against the Windows NT 4.0 SAM. If you 'are part of a Windows NT domain, then the WinNT provider is your only 'choice. If you are querying against AD or Exchange, then you should be 'using the LDAP provider. Go to www.microsoft.com/adsi for some 'examples of syntax for both. try Sub try Dim items, i, dict, root, domain Dim groups On Error Resume Next Set fso = GetObject("Scripting.FileSystemObject") If err Then err.clear On Error GoTo 0 Set fso = CreateObject("Scripting.FileSystemObject") End If domain = InputBox("Enter the name of the domain:","Domain","myDomain") If domain = "" Then Exit Sub GroupName = InputBox("Enter the name of the group:","User","myGroupName") If Groupname="" Then Exit Sub On Error Resume Next Set Group = GetObject("WinNT://" & domain & "/" & GroupName & ",group") If group Is Nothing Then MsgBox "Group not found" Exit Sub End If If fso.fileexists("c:\ldap.htm") Then fso.deletefile("c:\ldap.htm") Set f = fso.opentextfile("c:\ldap.htm",8,true) 'append f.write "" f.write "Info for " & Group.name & ", " & group.description & "
" '************************************************ '* get NT groups '************************************************ f.write "

" i=0 For each member in Group.members i=i+1 f.write "" Next f.write "
" & i & " " & member.name & "
" f.write "" f.close Set f=nothing Set Shell = CreateObject("Wscript.Shell") shell.run("c:\ldap.htm") Set root=nothing Set items=nothing Set shell=nothing Set fso=nothing Set Group=nothing End sub