3/6/08

Local Admin

To add a domain group to the local admins group on all your workstations, fire up a group policy and edit the computer startup scripts. Here are two scripts I've tested:

1) Batch file:
NET LOCALGROUP Administrators /ADD "YourDomain\YourDomainGroup"

2) VBScript:
On Error Resume Next
MyDomainName = "InsertYourDomainName"
MyDomainGroup = "InsertYourDomainGroup"

Set x = WScript.CreateObject("WScript.Shell")
ComputerName=x.ExpandEnvironmentStrings("%COMPUTERNAME%")

Set Local_Admins=getobject("WinNT://" & ComputerName & "/Administrators,group")
Local_Admins.add ("WinNT://" & MyDomainName & "/" & MyDomainGroup & ",group")


Computer startup scripts run with practically unlimited local permission; logon scripts rely on the current user's permission.