Help with my WMI

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Moving forward with AD I am learning that I require the WMI skill to take
full advantage of GPO's.
I would like my script to Add a specified group to the pc's Local Admin
account.
My script won't run and has no form on debugging.
I modified the script to suite my requirements.
Pls can someone check it out and provide some input
Thanx in advance ,
Julian
'Beginning Of the Script

On Error Resume Next

'get main objects/variables
Set ws = WScript.CreateObject ( "WScript.Shell" )
compname = ws.ExpandEnvironmentStrings ( "%COMPUTERNAME%" )
Set adGrp = GetObject ( "WinNT://" & compname & "/Administrators,group" )

'add domain groups to local admin group
adGrp.Add ( "WinNT://coronation/Desktop Admins,group" )

'End of the Script
 
You could use the "Restricted Groups" policy to add members to a "Restricted
Group"

Look in: Computer Config> Windows Settings> Security Settings> Restricted
Groups.

If you don't have one of the patches installed (sorry, don't have the number
or link off hand), the policy is replacing whatever the computer had for the
restricted group members. If you did install the patch, then it is
additive. So don't forget to put "Domain Admins" and whatever else you
wanted in that policy.
 
Back
Top