Removing NT domain account from workstation local administrator group

Posted on 2004-11-29
Last Modified: 2013-12-04
Current configuration for all of our 2k workstations included adding the NT domain user to the local administrator group.  Looking to remove via batch or script.  Are there any wild cards that can be used to remove any user from a domain from that group? Thanks!
Question by:drsst4
    LVL 12

    Accepted Solution

    Hi drsst4,

    It has been a while since I have done this but if memory serves correct you could issue this command via script.

    net localgroup "Administrators" "Account to delete" /delete

    God Bless

    Author Comment

    thats what I was looking at as well...just curious if there are wild cards available for "Account to Delete".  ie DOMAIN NAME\* , in an effort to remove any domain accounts. Thanks

    Author Comment

    works w %username%
    LVL 4

    Assisted Solution

    If you're using Active Directory, you could also push down a Group Policy that sets the membership of the Administrators group using the Computer Configuration > Windows Settings > Security Settings > Restricted Groups.  This allows you to specify a list of users and/or groups that you define to be members of the "restricted group".  Any account/group that's currently a member of that restricted group, but which you don't list in your policy, will be removed from the group membership:;en-us;228496

    Check out the Windows XP Security Guide for more details on the Restricted Groups feature:

    And check out this article for some troubleshooting tips that may be helpful when you start using this:;en-us;320099

    Featured Post

    Scale it in WD Gold

    With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    unsigned drivers windows 20 39
    Bitlocker Drive Recovery 2 130
    Deleting .CRYTO files after ransonware virus 4 59
    Thin secure Windows 10 5 20
    In a recent article here at Experts Exchange (, I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
    Users of Windows 10 Professional can disable automatic reboots using the policy editor. This tool is not included in the Windows home edition. But don't worry! Follow the instructions below to install (a Win7) policy editor on your Windows 10 Home e…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 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