I got started with this in another thread and I am not sure where I went wrong...I am looking to call an AD script from our login.bat file to change the computer's local admin password and to disable the computer's local guest account. I am doing this so each time any machine is used to log into the domain both of these items are performed. (All domain users, except admin accounts, run login.bat...)
Dim fso, ts, password, admin, computer
Set fso = CreateObject("Scripting.FileSystemObject"
Set password = fs
penTextFile("\\SERVER1\passowrd.txt", 1)
ts.close
Dim objNet
Set objNet = Createobject("WScript.Network"
admin = "Administrator"
computer = objNet.ComputerName
Dim User
Set User = GetObject ("WinNT://" & computer & "/"& admin &"",user)
Call User.SetPassword(password)
Set objNet = Nothing
Set objUser = GetObject("WinNT://" & computer & "/Guest"
objUser.AccountDisabled = True
objUser.SetInfo
Dim fso, ts, password, admin, computer
Set fso = CreateObject("Scripting.FileSystemObject"
Set password = fs
ts.close
Dim objNet
Set objNet = Createobject("WScript.Network"
admin = "Administrator"
computer = objNet.ComputerName
Dim User
Set User = GetObject ("WinNT://" & computer & "/"& admin &"",user)
Call User.SetPassword(password)
Set objNet = Nothing
Set objUser = GetObject("WinNT://" & computer & "/Guest"
objUser.AccountDisabled = True
objUser.SetInfo