Solved

Add Domain users to LocalGroup in remote Windows Servers

Posted on 2013-12-26
8
46 Views
1 Endorsement
Last Modified: 2015-08-15
Hi,
I would like to add few Domain user and Local users in Local Group of multiple servers.
I want to do this task via a script (VBS or any command line batch files) remotely from one servers without installing any additional tools.  The remote servers are combination of Windows 2000, Windows 2003, windows 2008. Thank You
1
Comment
Question by:GodMother
8 Comments
 
LVL 37

Expert Comment

by:Bing CISM / CISSP
Comment Utility
0
 

Author Comment

by:GodMother
Comment Utility
How to add a domain user to local admin group in multiple remote computers please.

for example: I have users as  DOMAIN-A\User1,  DOMAIN-A\User2
And I need to add above users to Local Administrators group in ComputerA, ComputerB, ComputersC etc...
0
 
LVL 35

Expert Comment

by:Mahesh
Comment Utility
Create one global group in domain
Add all required domain users in this group

Create a simple batch file like this:
net localgroup administrators domain\group /add

Replace domain with your domain NetBIOS name and group with one created above

create one OU and move all client computers to that OU and apply new GPO on this OU
In GPO, configure above code as computer startup batch script, so that when client computers get rebooted next time the above group will automatically added to local administrators group on all client computers in OU

Alternatively you can use GPO restricted group feature to achieve same results
Only thing you need to add domain admins group as well in addition to above group
http://myitforum.com/cs2/blogs/rdixon/archive/2008/06/17/how-to-add-domain-accounts-to-local-administrators-group-using-gpo.aspx

Mahesh
0
 
LVL 12

Expert Comment

by:Vaseem Mohammed
Comment Utility
I have used restricted group in production environment to add desktop engineers as local administrator on clients PC.

Create a group in AD, add all the users to group.
Create a GPO, Add the newly created group in Restricted groups and add the "Administrators" in "This group is member of" check attached screenshot.

attach the policy to computers container OU.
Run gpupdate /force and the group will be a part of "Local Administrators" group.
You cannot attach to the default computer container in AD. you will need to create a new OU and move all computer accounts there.


Note: Best is to use redir cmp, so that any new computer accounts goes to new OU. A complete different topic to discuss on it.
SCAP-0005.png
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 12

Expert Comment

by:Dave
Comment Utility
Its generally not a great idea to add individual users to local groups on servers. If you do then when the users leave and you remove their accounts you get "hanging SIDS" when you look at those group membership lists on the servers.

I would always create a group on the Domain and add the users to that group.

I would then use the "restricted groups" feature of group policy to control membership of the admins group. If you use the startup script the membership is not reset until a re-boot. If its set via policy the policy is re-applied at regular intervals. This means if some one tampers its fixed much sooner.
0
 

Author Comment

by:GodMother
Comment Utility
I do not have domain administrator privileges, but only local admin to my servers. And there still workgroup model servers in my environment due to the need of applications.
That why domain level will not work fully for me. From all the valuable inputs from different experts, I feel it is what I need to do manually or using simple batch files using net user command.
0
 

Author Comment

by:GodMother
Comment Utility
Seems so far there is no option to address my query. request please close the question.
0
 
LVL 12

Accepted Solution

by:
Dave earned 200 total points
Comment Utility
If the questioner had stated at the start that:-

I do not have domain administrator privileges, but only local admin to my servers. And there still workgroup model servers in my environment due to the need of applications.
 That why domain level will not work fully for me.  

at the beginning then we could have said quickly that as he says:-

From all the valuable inputs from different experts, I feel it is what I need to do manually or using simple batch files using net user command.

workgroup servers can't easily be remotely managed.  He could use the PSEXEC tool:-

https://technet.microsoft.com/en-us/sysinternals/bb897553

to run the scripts on the remote servers.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Many admins will agree: WSUS is is a nice invention but using it on the client side when updating a newly installed computer is still time consuming as you have to do several reboots and furthermore, the procedure of installing updates, rebooting an…
INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now