I have a script I got from a scripting guy and he swears this works for him, but I continue to get an error when the startup script runs on the workstations saying the error is on "Line 16, Char 1". I can run this interactively when logged on with Admin permissions without error. So right now this is configured in AD as a Computer Object GPO to run as a StartUp Script, so running with SYSTEM account privileges. Can anyone help me get this to work please? Thanks in advance. The script is below.
---------- BEGIN SCRIPT
Set objWshNet = CreateObject("WScript.Network")
strDomain = objWshNet.UserDomain
strComputer = objWshNet.ComputerName
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
' Configure to add a domain group to the Local Administrators Group
strUser = "Desktop Support"
Set objUser = GetObject("WinNT://" & strDomain & "/" & strUser & ",group")
' We actually add the user or group here, if not already a member of the local
' Administrators group
If Not objGroup.IsMember(objUser.ADsPath) Then
objGroup.Add(objUser.ADsPath)
End If
----------- End Script
---------- BEGIN SCRIPT
Set objWshNet = CreateObject("WScript.Network")
strDomain = objWshNet.UserDomain
strComputer = objWshNet.ComputerName
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
' Configure to add a domain group to the Local Administrators Group
strUser = "Desktop Support"
Set objUser = GetObject("WinNT://" & strDomain & "/" & strUser & ",group")
' We actually add the user or group here, if not already a member of the local
' Administrators group
If Not objGroup.IsMember(objUser.ADsPath) Then
objGroup.Add(objUser.ADsPath)
End If
----------- End Script