
Untitled
By: a guest on
May 27th, 2012 | syntax:
None | size: 0.57 KB | hits: 14 | expires: Never
How Can I disable user account of admin group on a remote machine with the help of VBS
strUser = "myUser"
strComputer = "myremoteComuter"
strPassword = "myPassword_"
Set objUser = GetObject("WinNT://" & strComputer & "/" & strUser & ",user",strUser,strPassword)
If Err.Number = 0 Then
objUser.AccountDisabled = true
objUser.SetInfo
End If
Const ADS_SECURE_AUTHENTICATION = 1
Set objUser = GetObject("WinNT:").OpenDSObject("WinNT://MyDomain/UserNameToEnable,user",AdminUserName,AdminUserPassword, ADS_SECURE_AUTHENTICATION)
objUser.AccountDisabled = true
objUser.SetInfo