PowerShell Genie

New-ADGroup

Use New-ADGroup to create a security or distribution group in Active Directory.

Command 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn — New-ADGroup

Syntax

1PS> New-ADGroup [-Name] <String> -GroupScope <ADGroupScope> [-GroupCategory <ADGroupCategory>] [-Path <String>] [-Description <String>] [-SamAccountName <String>] [-WhatIf] [<CommonParameters>]
See the command anatomy

Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.

New-ADGroup [-Name] <String> -GroupScope <ADGroupScope> [-GroupCategory <ADGroupCategory>] [-Path <String>] [-Description <String>] [-SamAccountName <String>] [-WhatIf] [<CommonParameters>]
  1. Stage 1New-ADGroup-Name -GroupScope -GroupCategory -Path -Description -SamAccountName -WhatIf

    Try it

    Windows PowerShell

    PowerShell example · browser support is limited.

    Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.

    Interactive simulation · fictional data

    Examples

    New-ADGroup -Name "Sales-Read"

    1PS> New-ADGroup -Name "Sales-Read" -GroupScope Global -GroupCategory Security -Path "OU=Groups,DC=corp,DC=local" -Description "Read access to sales share"
    Show reference output

    Sample output · fictional data, shaped like the real thing

    DistinguishedName : CN=Sales-Read,OU=Groups,DC=corp,DC=local
    GroupCategory     : Security
    GroupScope        : Global
    Name              : Sales-Read
    ObjectClass       : group
    SamAccountName    : Sales-Read

    New-ADGroup -Name "App-Users"

    1PS> New-ADGroup -Name "App-Users" -GroupScope Universal
    Show reference output

    Sample output · fictional data, shaped like the real thing

    Name      GroupScope GroupCategory
    ----      ---------- -------------
    App-Users Universal  Security

    Get-ADGroup -Identity "Sales-Read"

    1PS> Get-ADGroup -Identity "Sales-Read" | Select-Object Name, GroupScope, GroupCategory
    Show reference output

    Sample output · fictional data, shaped like the real thing

    Name           GroupScope  GroupCategory
    -------------  ----------  -------------
    Sales-Read     Global      Security
    IT Operations  Global      Security

    Parameters

    Parameter definitions:

    • -Name
    • -GroupCategory
    • -Path
    • -Description
    • -SamAccountName
    • -WhatIf

    New-ADGroup on Microsoft Learn

    Practical use and troubleshooting

    Practical scenario: Use New-ADGroup when you need to create a security or distribution group in Active Directory. Review syntax and sample output, then try an example in the browser lab. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.

    Common error and fix: A duplicate group-name error should trigger an existing-object check. Confirm the intended OU, scope and category before deciding whether to create or reuse a group. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.

    See also: Get-ADGroup. New-ADGroup creates a directory group; Get-ADGroup retrieves an existing group. Group scope and category are creation decisions, not evidence that any members have been assigned. Read the linked command before substituting it; similar names do not imply identical inputs or output.

    New-ADGroup reference on Microsoft Learn

    Recap

    New-ADGroup Use New-ADGroup to create a security or distribution group in Active Directory.

    Next: Get-ADGroup
    Genie guideNew-ADGroup

    Use New-ADGroup to create a security or distribution group in Active Directory. The console below is pre-loaded — run it, then change a value and run it again.