How to create a group in Active Directory using PowerShell scripts?

Read on to know how to create a group in Active Directory (AD) using PowerShell and how you can get it done easier with ADManager Plus.

Windows PowerShell

  • Identify the domain in which the group is to be created.
  • List the attributes that have to be added.
  • Create and compile the script for creating the desired group. Execute the script in PowerShell.
  • Sample script for creating a group:
  •  Copied
    PS C:\> Import-Module ActiveDirectory New-ADGroup -Name "DemoGroup1" -SamAccountName "DemoGroup1" -GroupScope Global -GroupCategory Security
    Click to copy entire script
  • To create groups in bulk, you have to write a separate script.

ADManager Plus

  • Navigate to Management > Group Management > Create Single Group.
  • Enter the attribute values for the group. You can even import this list from a CSV file. Click Create.

Screenshot

Create Active Directory Groups using ADManager Plus

» Start 30-day Free Trial

Although creating a group with native tools like PowerShell looks simple, it comes with a few limitations:

  • PowerShell scripts can be run only from the computers which have the Active Directory Domain Services role installed in them.
  • The script has to be rewritten if additional attributes are to be added.
  • Need for a new script, in case multiple groups are to be created.
  • The syntax, parameters and iterations need to be correct. A typo or incorrect syntax might be difficult to spot and rectify, especially when the script is a long one.

ADManager Plus lets you perform the same with a few clicks from its web based GUI console. It also has options for creating multiple groups simultaneously with templates and by importing a CSV file containing the values for the group attributes. You can learn more about it here.

Provision AD groups in bulk without breaking a sweat with ADManager Plus' bulk management features.

  Get 30-day free trial.
  • Embark on your script-free AD management, reporting, and automation journey with ADManager Plus.
  •  
     
  • By clicking 'Start your free trial now', you agree to processing of personal data according to the Privacy Policy.
  • Thanks
  • Your download should begin automatically in 15 seconds. If not, click here to download manually.

Related Powershell How-to Guides:

The one-stop solution toActive Directory Management and Reporting

Email Download Link