shoris
asked on
VB Script = Add User to the local Machine
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.
Dim oGrpLocal
On Error Resume Next
Set oGrpLocal = GetObject ("WinNT://./administrators ,group")
If err.Number <> 0 then
WScript.Quit
End If
'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/O ULocalAdmi ns") Then
oGrpLocal.Add "WinNT://DOMAIN/OULocalAdm ins"
End If
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.
Dim oGrpLocal
On Error Resume Next
Set oGrpLocal = GetObject ("WinNT://./administrators
If err.Number <> 0 then
WScript.Quit
End If
'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:
oGrpLocal.Add "WinNT://DOMAIN/OULocalAdm
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.