VB Script = Add User to the local Machine
Posted on 2007-10-09
For some reason this script may be old.. Does the job when i add the computer to the local admin groups on the computer. But now each time the computer boots up, the script runs .. how can i hide the script giving the error message or adjust it that it works properly
I have this script as a startup script from my AD 2003 - basically adding the Administrator from the OU to the local admin acocunt on the computer.
On Error Resume Next
Set oGrpLocal = GetObject ("WinNT://./administrators,group")
If err.Number <> 0 then
'The DOMAIN below is the netbios domain name, and OULocalAdmins is the name of the group you
'want to add to the local administrators group.
If Not oGrpLocal.IsMember("WinNT://DOMAIN/OULocalAdmins") Then