here is a script that you can use.  It dumps the group to a spreadsheet with column headers.  Modify as you see fit
 
Diane
 
------------------------------------------------
 
On Error Resume Next
 
CRLF=CHR(13)+CHR(10)
 
strADName = InputBox("Enter Complete LDAP DN for desired group","Group Name?","")
Set GroupObj = GetObject("LDAP://" & strADname)
 
wscript.echo ("Getting group Membership for " & strADName)
 

if Err.Number <0 then
wscript.echo "Failed to connect to " & strADName
wscript.quit
end if
 

set memberlist=GroupObj.Members
Set objExcel = WScript.CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
 
objExcel.ActiveSheet.Name = GroupObj.SAMAccountName
objExcel.ActiveSheet.Range("A1").Activate
objExcel.ActiveCell.Value = "ID"   'col header 1
objExcel.ActiveCell.Offset(0,1).Value = "Last Name" 'col header 2
objExcel.ActiveCell.Offset(0,2).Value = "First Name" 'col header 3
objExcel.ActiveCell.Offset(0,3).Value = "Address" 'col header 4
objExcel.ActiveCell.Offset(0,4).Value = "Office" 'col header 5
objExcel.ActiveCell.Offset(0,5).Value = "Internal Phone" 'col header 6
objExcel.ActiveCell.Offset(0,6).Value = "External Phone" 'col header 7
objExcel.ActiveCell.Offset(0,7).Value = "Mobile" 'col header 8
objExcel.ActiveCell.Offset(1,0).Activate  'move 1 down
 
for each member in memberlist
 If Len(member.SAMaccountName)=4 then
  objExcel.ActiveCell.Value = member.SAMAccountName
  objExcel.ActiveCell.Offset(0,1).Value = member.sn
  objExcel.ActiveCell.Offset(0,2).Value = member.givenName
  objExcel.ActiveCell.Offset(0,3).Value = member.streetAddress
  objExcel.ActiveCell.Offset(0,4).Value = member.physicalDeliveryOfficeName
  objExcel.ActiveCell.Offset(0,5).Value = member.telephoneNumber
  objExcel.ActiveCell.Offset(0,6).Value = member.otherHomePHone
  objExcel.ActiveCell.Offset(0,7).Value = member.mobile
  objExcel.ActiveCell.Offset(1,0).Activate
 End if
next
 
set GroupObj = Nothing
 

wscript.echo "Done"
wscript.quit


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Frank Abagnale
Sent: Friday, November 25, 2005 8:02 AM
To: Active
Subject: [ActiveDir] exporting group membership

I am trying to export the following fields from Active Directory using CSVDE
 
I ran the following command
CSVDE -F c:\output.csv -d "ou=security groups,ou=INTARA,dc=COM" -r "(objectclass=group)" -l cn,d
escription,member,whencreated,whenchanged,info,managedby,mail
 
This retrieves the information I want, however, the Member tab displays a list of users full DN in one single cell and makes it difficult to overview the member list.
 
How can I display a list of the users in there own individual cells going downwards (if that makes sense) does CSVDE allow this? If not any other tools out there?


Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

Reply via email to