ray3d84
-
Total Posts
:
1
- Scores: 0
-
Reward points
:
0
- Joined: 8/31/2009
-
Status: offline
|
Disabling machine
Monday, August 31, 2009 6:37 AM
( permalink)
I came across this script below for Disabling machine and written by Ronen Shurer. I have tried modifying to disable computer account on my domain and get error Code 800a000d and it fails. Wondering how can I modify this so it s successful. My AD structure domain is XXX the computers are in a OU called NY that has a OU name computers and finally the desktop computers are in OU desktop. Can any one help? BScript'========================================================================== ' NAME: DisableMachines.vbs ' AUTHOR: Ronen Shurer ' DATE : 02/05/2006 ' COMMENT: This script will disable computer accounts on the domain ' according to a supplied list of machines. '========================================================================== 'Constants Declaration Const ForReading = 1 'For text file reading InputFileName = "c:\machines.txt" DomainString = "netbiosdomainname" '========================================================================== On Error Resume Next set myFSO = CreateObject("Scripting.FileSystemObject") set myFile = myfso.openTextFile(InputFileName, ForReading) set DomainObj = GetObject("WinNT://" & DomainString) Do strComputer = myFile.readline set objComputer = GetObject("LDAP://CN=" & strComputer & ",CN=Computers,DC=mydomain,DC=com") objComputer.AccountDisabled = True objComputer.SetInfo WScript.Echo("Disabled " & strComputer & " on Active Directory") Loop Until myFile.AtEndOfStream Set DomainObj = Nothing myFile.Close
|
|
|
|