Add or Remove AD Users

Use a simple script to quickly and easily add or remove a Windows NT user ID at the command prompt.

ITPro Today

December 10, 2006

1 Min Read
ITPro Today logo in a gray background | ITPro Today


As an Active Directory (AD) administrator, I often receive requests to add or remove users from various groups. I dislike AD's GUI for adding and removing users; I wanted a quicker solution that requires fewer clicks.

I wrote the Membership.vbs script (which you can download at Instant-Doc ID 94354) to quickly and easily add or remove oneWindows NT user ID at the command prompt. The command runs in the CScript command shell, and the command syntax is:

membership.vbs    <+ / -> 

To add an NT ID (ntid1) into a global group (globalgrp1), type:

membership ntid1 globalgrp1 + 

To remove ntid1 from globalgrp1, type:

membership ntid1 globalgrp1 

To add multiple NT IDs, you can use the Microsoft Windows NT Server 4.0 Resource Kit tool usrtogrp.exe. This tool doesn't let you remove multiple NT IDs.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like