RE: Script to extract users and groups from AD



Try to look something like the script below.

bye
Eng



Author: Eugenio Talarico
mailto: eugeniotalarico@xxxxxxxxxxxxxxxxxxxx

Description:
Dump users from domain. Usage: cscript //nologo SCRIPT_NAME.VBS >
OUTPUTFILE.TXT Take the outputfile.txt and import into excel; notice that the
! is needed to separate the colum during the import process. With this you
can dump the user and groups from the source domain.

Script:

'BEGIN SCRIPT
'** By Eugenio Talarico
'** mailto: eugeniotalarico@xxxxxxxxxxxxxxxxxx
Option Explicit
Dim objDomain, objUser, objGroup

Set objDomain = GetObject("WinNT://PUT_HERE_DOMAIN_NAME")
objDomain.Filter = Array("user")

For Each objUser In objDomain
Wscript.Echo "User:! " & objUser.Name & " ! FULL_NAME:! " &
objuser.fullname & " ! Description:! " & objuser.description
Next

objDomain.Filter = Array("group")

For Each objGroup In objDomain
Wscript.Echo "Group: " & objGroup.Name
For Each objUser In objGroup.Members
Wscript.Echo "Member: " & objUser.Name
Next
Next

'END Script

.