Commands › Exchange Online

New-RoleGroup

Exchange Online ExchangeOnlineManagement New-*

Create management role groups.

Quick start script

# New-RoleGroup — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-RoleGroup
$before | Format-List

# 3. Make the change (dry run first)
New-RoleGroup -Name <String> -LinkedDomainController <String> -LinkedForeignGroup <UniversalSecurityGroupIdParameter> -WhatIf
New-RoleGroup -Name <String> -LinkedDomainController <String> -LinkedForeignGroup <UniversalSecurityGroupIdParameter>

# 4. Verify and diff
$after = Get-RoleGroup
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax — 2 parameter sets

CrossForest

New-RoleGroup [-Name] <String> -LinkedDomainController <String> -LinkedForeignGroup <UniversalSecurityGroupIdParameter>
 [-LinkedCredential <PSCredential>]
 [-Confirm]
 [-CustomConfigWriteScope <ManagementScopeIdParameter>]
 [-CustomRecipientWriteScope <ManagementScopeIdParameter>]
 [-Description <String>]
 [-DisplayName <String>]
 [-DomainController <Fqdn>]
 [-Force]
 [-ManagedBy <MultiValuedProperty>]
 [-Members <MultiValuedProperty>]
 [-RecipientOrganizationalUnitScope <OrganizationalUnitIdParameter>]
 [-Roles <RoleIdParameter[]>]
 [-SamAccountName <String>]
 [-WellKnownObject <String>]
 [-WhatIf]
 [<CommonParameters>]

Default

New-RoleGroup [-Name] <String>
 [-Confirm]
 [-CustomConfigWriteScope <ManagementScopeIdParameter>]
 [-CustomRecipientWriteScope <ManagementScopeIdParameter>]
 [-Description <String>]
 [-DisplayName <String>]
 [-DomainController <Fqdn>]
 [-Force]
 [-Id <Guid>]
 [-ManagedBy <MultiValuedProperty>]
 [-Members <MultiValuedProperty>]
 [-RecipientOrganizationalUnitScope <OrganizationalUnitIdParameter>]
 [-Roles <RoleIdParameter[]>]
 [-SamAccountName <String>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (19)

ParameterTypeRequiredWhat it controls
-Name String yes The Name parameter specifies the name of the new role group. The name can have a maximum of 64 characters. If the name contains spaces, enclose the name in quotation marks (").
-LinkedDomainController String yes This parameter is available only in on-premises Exchange.
-LinkedForeignGroup UniversalSecurityGroupIdParameter yes This parameter is available only in on-premises Exchange.
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-CustomConfigWriteScope ManagementScopeIdParameter This parameter is available only in on-premises Exchange.
-CustomRecipientWriteScope ManagementScopeIdParameter The CustomRecipientWriteScope parameter specifies the existing recipient-based management scope to associate with management role assignments created with this role group. If the management scope name contains...
-Description String The Description parameter specifies the description that's displayed when the role group is viewed using the Get-RoleGroup cmdlet. Enclose the description in quotation marks (").
-DisplayName String The DisplayName parameter specifies the friendly name of the role group. If the name contains spaces, enclose the name in quotation marks ("). This parameter has a maximum length of 256 characters.
-DomainController Fqdn This parameter is available only in on-premises Exchange.
-Force SwitchParameter This parameter is available only in the cloud-based service.
-Id Guid This parameter is available only in Security & Compliance PowerShell.
-LinkedCredential PSCredential This parameter is available only in on-premises Exchange.
-ManagedBy MultiValuedProperty The ManagedBy parameter specifies the users or USGs who can modify the configuration of a role group or add and remove members to or from a role group.
-Members MultiValuedProperty The Members parameter specifies the mailboxes or mail-enabled USGs to add as a member of the role group. You can identify the user or group by the name, DN, or primary SMTP address value. You can specify multiple...
-RecipientOrganizationalUnitScope OrganizationalUnitIdParameter This parameter is available only in on-premises Exchange.
-Roles RoleIdParameter[] The Roles parameter specifies the management roles to assign to the role group when it's created. If a role name contains spaces, enclose the name in quotation marks ("). If you want to assign more that one role,...
-SamAccountName String This parameter is available only in on-premises Exchange.
-WellKnownObject String This parameter is available only in the cloud-based service.
-WhatIf SwitchParameter The WhatIf switch doesn't work in Security & Compliance PowerShell.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.