AD export info

J

JDM

Is there a script or command (with the options) for me to be able to
export all of our disabled user accounts listed in the AD to a file? I
have played around with CSVDE and cannot seem to get it to work. All
I need is an exported file with all of our disabled user accounts in it.

does anyone have a way to do this?

Thanks you!!!

JDM
 
R

Richard McCall [MSFT]

Dim objarg

Dim tDomain

Dim fso

Dim outFile



set objarg = wscript.arguments



If objarg.count = 0 then

Wscript.Echo "Domain Parameter Missing"

Wscript.quit

end if



tdomain = objarg(0)



set oDom = GetObject("WinNT://" & tdomain & ",domain")



oDom.filter = Array("User")



'Instantiate the File System Object

Set fso = CreateObject("Scripting.FileSystemObject")



'Create the output file.

Set outFile = fso.CreateTextFile("C:\accounts.txt")



On Error Resume Next



'Look through each user record

For each oUser in Odom

outFile.WriteLine (oUser.name & vbTab & oUser.AccountDisabled)

next
 
J

Joe Richards [MVP]

This will locate all disabled users in your forest

adfind -gc -b -bit -f useraccountcontrol:AND:=2 -dn


This will locate all disabled users in a domain

adfind -b dc=domain,dc=com -bit -f useraccountcontrol:AND:=2 -dn


joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top