March, 2008
2003 server - Monday, March 3, 2008 7:18 - 0 Comments
Using a Script to Add a Domain User to a Local Group
There are sometimes situations when you need to be able to script the process of adding a domain user to a local group on a machine. Here is a script that will do just that.
I ran into a scenario recently where I needed to add a domain group to the local administrators group of a large collection of workstations in my network. Rather than go around to all 500 of these machines individually I found a very useful little VBS script for getting this done.
option Explicit
Dim objGroup
Dim strComputer
On Error Resume Next
‘Variables you will want to change
strComputer = “.” ‘Computer is Local
‘Create Objects
Set objGroup = GetObject(”WinNT://” & strComputer & “/Administrators,group”)
‘Modify group memberships
objGroup.add(”WinNT://DOMAIN/GROUPNAME,group”)
Set objGroup = Nothing
Replace your variables, push this out via GPO, and voila! Enjoy!
Article written by MyComputerAid.com
- Can’t Ping the Server
- When to shorten your DHCP lease period
- When to lengthen your DHCP lease period
- Configuring the DHCP Cleanup Cycle
- Troubleshooting network connectivity with a DHCP server
- Troubleshooting network browsing issues
- Disabling Automatic Private IP Addressing
- Troubleshooting Network Connections with Netsh
- Round Robin DNS and VPN Servers

