Categories: User Accounts

Add user to domain group from command prompt

If you are a domain administrator and looking to add users to domain  or active directory group from command prompt, this post shows you how to do that with net group command.

Execute the below steps to add users to domain group.

  1. Open command prompt
  2. Run the below command
    net group groupName userName /ADD /DOMAIN

Example:
To add a user named ‘dave’ to the domain group “Domain Admins”

C:\>net group "Domain Admins" testuser /ADD /DOMAIN
The command completed successfully.

Now list the members of the domain group.

C:\>net group "Domain Admins"
Group name     Domain Admins
Comment        Designated administrators of the domain

Members
-------------------------------------------------------------------------------
Administrator            dave
The command completed successfully.

In this example case, the group name has white space in it, that’s why it’s wrapped up double quotes, so that the command reads the whole thing as as group name.

Srinivas

View Comments

Recent Posts

Add new user account from command line (CMD)

Adding users from command line is much easier than going through the UI. It saves…

4 years ago

Delete directory from command line [Rmdir]

Do you want to delete a directory from Windows command prompt(CMD)? This post explains how…

4 years ago

TaskKill: Kill process from command line (CMD)

We can kill a process from GUI using Task manager. If you want to do…

4 years ago

Kill Chrome from command line

Chrome is definitely the stable browser compared to other ones and it has been my…

4 years ago

Find windows OS version from command line

Windows has multiple command line utilities that can help find the version of the Windows…

4 years ago

How to check if Windows 32 or 64 bit?

There are multiple ways to check whether a Windows computer is running 32-bit OS or…

7 years ago