Script to disable bulk user account
Hi,
On daily basis i have to disable user accounts from AD; hence I am looking for vb script to disable user accounts using csv/excel file.
Can anybody pls help me??
Andy
Software
Hi,
On daily basis i have to disable user accounts from AD; hence I am looking for vb script to disable user accounts using csv/excel file.
Can anybody pls help me??
Andy
by coolandy.net Accepted solution
by jellimonsta Accepted solution
Many sample scripts can be found here.
http://tinyurl.com/2yu84v
Regards.
by coolandy.net Accepted solution
I have checked out there and found one simple script using which i can disable one account at a time.
What i am looking at is searching user accounts with there username inserted into a file and disable that ID.
I am not a scripting guys hence seeking help..
pls reply...
by jellimonsta Accepted solution
The reply to this user post may help...
by gv.kumaran Accepted solution
Have u got the VB Script, how to disable multiple users in AD ?
YOU CAN USE THE BELOW GIVE SCRIPT
DISABLE.TXT SHOULD CONTAIN DN ( distinguishedName )
PLEASE REPLY IF THIS DIDN'T WORK.
IT WORKS FOR ME VERY WELL.
VASANTHA
===========================
Set fp = Createobject("Scripting.Filesystemobject")
set fpt1 = fp.opentextfile("c:\disable.txt")
rdata = fpt1.readall
data = split(rdata, vbcrlf)
for each i in data
Set B = getobject ("LDAP://" & i )
intUCA = B.get("useraccountcontrol")
B.put "useraccountcontrol", 1
'B.hidefromaddressbook = True
B.setinfo
Next
Wscript.echo "Done"
by encounterking Accepted solution
is it required to put the whole LDAP address of the OU of the user ?
Or should i run it the way you have posted it here ? i get an error at :
*Set B = getobject ("LDAP://" & i )*
This discussion is closed to new replies.
Sort by Trending