Managing membership in Active Directory security groups is crucial for ensuring that users have the appropriate level of access to resources and services. By adding users to security groups, admins can simplify access management and eliminate the need to assign permissions individually.
- Open the Active Directory Users and Computers console.
- Right-click on the desired security group and select Properties.
- Navigate to the Members tab and click Add.
- Click Object Types to specify the type of object you want to add.
- Use the Locations button to select the desired location.
- Enter a username in the Enter the object names to select field, click Check Names, and choose the user. If you want to add more than one user, repeat this step to add all the required users.
- After selecting the appropriate members, click OK.
- Finally, click Apply and then OK to save your changes.
Managing security group members through ADUC is tedious and inefficient for bulk operations. PowerShell provides a faster and more reliable way to handle these tasks efficiently.
To add a member to a security group using PowerShell, run the following command. Replace <SecurityGroupName> with the name of the security group and <UsersSAMAccountName> with the name of the user or object you're adding.
Add-ADGroupMember -Identity '<SecurityGroupName>' -Members '<UserSAMAccountName>'
To add multiple users to a group, pass a list of usernames directly into the -Members parameter. For added convenience, especially when working with a CSV file containing user data, use the Import-Csv cmdlet to add dozens or even hundreds of users at once.
$users = Import-Csv "<FilePath>"
Add-ADGroupMember -Identity "<SecurityGroupName>" -Members $users.<RespectiveColumnName>
Note: In addition to users, you can also add other objects such as groups, contacts, computers, and more as members of a security group in Active Directory.