Commands › Exchange Online
Set-RoleGroup
Modify who can add or remove members to or from management role groups or change the name of the role group.
Quick start script
# Set-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)
Set-RoleGroup -Identity <RoleGroupIdParameter> -LinkedDomainController <String> -LinkedForeignGroup <UniversalSecurityGroupIdParameter> -WhatIf
Set-RoleGroup -Identity <RoleGroupIdParameter> -LinkedDomainController <String> -LinkedForeignGroup <UniversalSecurityGroupIdParameter>
# 4. Verify and diff
$after = Get-RoleGroup
Compare-Object ($before | Out-String) ($after | Out-String)
Syntax — 2 parameter sets
CrossForest
Set-RoleGroup [-Identity] <RoleGroupIdParameter> -LinkedDomainController <String> -LinkedForeignGroup <UniversalSecurityGroupIdParameter>
[-LinkedCredential <PSCredential>]
[-BypassSecurityGroupManagerCheck]
[-Confirm]
[-Description <String>]
[-DisplayName <String>]
[-DomainController <Fqdn>]
[-ManagedBy <MultiValuedProperty>]
[-Name <String>]
[-WhatIf]
[<CommonParameters>]
Default
Set-RoleGroup [-Identity] <RoleGroupIdParameter>
[-Force]
[-BypassSecurityGroupManagerCheck]
[-Confirm]
[-Description <String>]
[-DisplayName <String>]
[-ManagedBy <MultiValuedProperty>]
[-Name <String>]
[-WellKnownObject <String>]
[-WhatIf]
[<CommonParameters>]
Parameters (14)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.