VB Script add local admin user if not exist
I want to check if a user exists, if it does, reset the password, if it doesn't, create it as a local admin that doesn't expire & account doesn't expire.
I've got separate parts working, but not all at once LOL :(
Grab the computer name:
Set Password & account to not expire:
' Retrieve NetBIOS name of local computer.Set objNetwork =CreateObject("Wscript.Network")strComputer = objNetwork.ComputerName
' Bind to local computer object.Set objComputer = GetObject("WinNT://" &strComputer)
Check user exists:
objUser.Put "UserFlags", 65600 '
Or any recommendations of sites or utilities to learn this stuff. Thanks.
Set objComputer = GetObject("WinNT://" & strComputer & "")
objComputer.Filter = Array("user")
intFound = 0