Link to home
Start Free TrialLog in
Avatar of manav08
manav08Flag for Australia

asked on

Batch script to delete all users from domain admin group but administrators

Hi Guys,

What I wanna achieve is same as mentioned here - http://blogs.technet.com/b/heyscriptingguy/archive/2005/12/12/how-can-i-delete-everyone-except-the-administrator-and-the-domain-admins-group-from-the-local-administrators-group.aspx but how do I do it from a batch script.

I know the command to add administrators is
net localgroup administrators /add "domain\user", but I want a script that will delete all users from administrators group, even ones that are unknown and we dont want to use Group Policy for this.
ASKER CERTIFIED SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi manav08,
Did the solution help you? If so, I'd appreciate you closing the question appropriately.
Avatar of manav08

ASKER

Apologies for my laziness in closing this question.
I havent tested but believe this is solution we were after