Add group to local administrator group

Hi,

I have a group that I want to add to local administrator group on all domain computers except the domain controllers.

When I add the group, I want those users/groups that are already there to still be there..., so just add no remove.

Earlier I have used a script called Set-ADAccountasLocalAdministrator but now we have changed to Windows 2012 R2, and it does not work. I have also looked at Group Policy to do this, but it seems to remove everything in the group.

I also need a script to list out users in the local administrator group for the remote computer, before I have used a script called Get-Remote-LocalAdmin, but this is not working on Windows Server 2012 R2. I tested a script called All-Local_Admins but ths list every computer, and I want to select, for example have it read from a txt file that contain computer names.

So if it possible with group policy that would be best.

July 2nd, 2015 6:27pm

Check the Gallery for a pre-written script, it will tell you if they have tested it on what versions of Windows. Also, it may be helpful to copy the script you are using to the forums when asking a question, and someone might be able to tell you why it doesn't work, and what needs to
Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2015 6:46pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics