Click to See Complete Forum and Search --> : [RESOLVED] VBScript: Add domain group to local administrators group


PeejAvery
March 10th, 2009, 01:13 PM
I'm working with a login script which adds a specific domain group to the local administrators group. Login scripts are supposed to run as SYSTEM. However, the following is giving me a "General access denied error" message. Any ideas?

Set objLocalGroup = GetObject("WinNT://./Administrators")
Set objADGroup = GetObject("WinNT://domain/groupname")
objLocalGroup.Add(objADGroup.ADsPath)
Set objLocalGroup = Nothing
Set objADGroup = Nothing

PeejAvery
March 10th, 2009, 02:23 PM
Well, apparently, the login script does not run with administrative rights unless the user logging in has domain or local administrative rights. Oh well. Problem solved.