Share via


Add a computer account to a group

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012

To add a computer account to a group

  • Using the Windows interface

  • Using a command line

Using the Windows interface

  1. Open Active Directory Users and Computers.

  2. In the console tree, click Computers.

    Where?

    • Active Directory Users and Computers/domain node/Computers

    Or, click the folder in which the computer is located.

  3. In the details pane, right-click the computer, and then click Properties.

  4. On the Member Of tab, click Add.

  5. In Enter the object names to select, type the name of a group that you want this computer to be a member of, and then click OK.

Notes

  • To perform this procedure, you must be a member of the Account Operators group, Domain Admins group, or the Enterprise Admins group in Active Directory, or you must have been delegated the appropriate authority. As a security best practice, consider using Run as to perform this procedure. For more information, see Default local groups, Default groups, and Using Run as.

  • To open Active Directory Users and Computers, click Start, click Control Panel, double-click Administrative Tools, and then double-click Active Directory Users and Computers.

  • When viewing users, computers, and groups as containers, you can add a computer to a group by dragging it onto the desired group. For more information about view options in Active Directory Users and Computers, see Related Topics.

  • By adding a computer to a group, you can assign permissions to all of the computer accounts in that group and filter Group Policy settings on all accounts in that group.

Using a command line

  1. Open Command Prompt.

  2. Type:

    Dsmod group GroupDN –addmbr ComputerDN
    

    For example, to add computer1 to Group A in the Contoso domain, type

    Dsmod "CN=Group A,OU=Domain Groups,DC=Contoso,DC=com" –addmbr "CN=Computer1,OU=Domain Computers,DC=Contoso,DC=com" 
    
Value Description

GroupDN

Specifies the distinguished names of the group object to which you want to add the computer object.

ComputerDN

Specifies the distinguished name of the computer object to be added to the group. The distinguished name specifies the directory location.

Notes

  • To perform this procedure, you must be a member of the Account Operators group, Domain Admins group, or the Enterprise Admins group in Active Directory, or you must have been delegated the appropriate authority. As a security best practice, consider using Run as to perform this procedure. For more information, see Default local groups, Default groups, and Using Run as.

  • To open a command prompt, click Start, point to All programs, point to Accessories, and then click Command prompt.

  • By adding a computer to a group, you can assign permissions to all of the computer accounts in that group and filter Group Policy settings on all accounts in that group.

  • To view the complete syntax for this command, at a command prompt, type:

    dsmod group /?

Information about functional differences

  • Your server might function differently based on the version and edition of the operating system that is installed, your account permissions, and your menu settings. For more information, see Viewing Help on the Web.

See Also

Concepts

Dsmod
Find a computer account
Command-line reference A-Z
Working with MMC console files
Managing Active Directory from MMC