Commands › Exchange Online

Set-ManagementScope

Exchange Online ExchangeOnlineManagement Set-*

Change an existing management scope.

Quick start script

# Set-ManagementScope — 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-ManagementScope
$before | Format-List

# 3. Make the change (dry run first)
Set-ManagementScope -Identity <ManagementScopeIdParameter> -DatabaseRestrictionFilter <String> -ServerRestrictionFilter <String> -WhatIf
Set-ManagementScope -Identity <ManagementScopeIdParameter> -DatabaseRestrictionFilter <String> -ServerRestrictionFilter <String>

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

Syntax — 3 parameter sets

DatabaseFilter

Set-ManagementScope [-Identity] <ManagementScopeIdParameter> -DatabaseRestrictionFilter <String>
 [-Confirm]
 [-DomainController <Fqdn>]
 [-Force]
 [-Name <String>]
 [-WhatIf]
 [<CommonParameters>]

ServerFilter

Set-ManagementScope [-Identity] <ManagementScopeIdParameter> -ServerRestrictionFilter <String>
 [-Confirm]
 [-DomainController <Fqdn>]
 [-Force]
 [-Name <String>]
 [-WhatIf]
 [<CommonParameters>]

RecipientFilter

Set-ManagementScope [-Identity] <ManagementScopeIdParameter>
 [-RecipientRestrictionFilter <String>]
 [-RecipientRoot <OrganizationalUnitIdParameter>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-Force]
 [-Name <String>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (10)

ParameterTypeRequiredWhat it controls
-Identity ManagementScopeIdParameter yes The Identity parameter specifies the name of the management scope to modify. If the name contains spaces, enclose it in quotation marks (").
-DatabaseRestrictionFilter String yes This parameter is available only in on-premises Exchange.
-ServerRestrictionFilter String 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.
-DomainController Fqdn This parameter is available only in on-premises Exchange.
-Force SwitchParameter This parameter is available only in the cloud-based service.
-Name String The Name parameter specifies the name of the management scope. The management scope name can be a maximum of 64 characters. If the name contains spaces, enclose it in quotation marks (").
-RecipientRestrictionFilter String The RecipientRestrictionFilter parameter uses OPATH filter syntax to specify the recipients that are included in the scope. The syntax is `"Property -ComparisonOperator 'Value'"`.
-RecipientRoot OrganizationalUnitIdParameter The RecipientRoot parameter specifies the organizational unit (OU) under which the filter specified with the RecipientRestrictionFilter parameter should be applied. Valid input for this parameter is an OU or domain...
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.

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