Commands › Exchange Online

Set-AdaptiveScope

Exchange Online ExchangeOnlineManagement Set-*

For more information, see Security & Compliance PowerShell. Use the Set-AdaptiveScope cmdlet to modify adaptive scopes in your organization.

Quick start script

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

# 3. Make the change
Set-AdaptiveScope -Identity <ComplianceRuleIdParameter> -AdministrativeUnit <Guid> -FilterConditions <PswsHashtable>

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

Syntax — 3 parameter sets

Default

Set-AdaptiveScope [-Identity] <ComplianceRuleIdParameter> -FilterConditions <PswsHashtable>
 [-AdministrativeUnit <Guid>]
 [-Comment <String>]
 [<CommonParameters>]

AdaptiveScopeRawQuery

Set-AdaptiveScope [-Identity] <ComplianceRuleIdParameter> -RawQuery <String>
 [-AdministrativeUnit <Guid>]
 [-Comment <String>]
 [<CommonParameters>]

AdministrativeUnit

Set-AdaptiveScope [-Identity] <ComplianceRuleIdParameter> -AdministrativeUnit <Guid>
 [-Comment <String>]
 [<CommonParameters>]

Parameters (5)

ParameterTypeRequiredWhat it controls
-Identity ComplianceRuleIdParameter yes The Identity parameter specifies the adaptive scope that you want to modify. You can use any value that uniquely identifies the adaptive scope. For example:
-AdministrativeUnit Guid yes {{ Fill AdministrativeUnit Description }}
-FilterConditions PswsHashtable yes The FilterConditions parameter specifies the conditions that are included in the dynamic boundary. Valid syntax and values depend of the value of the LocationType parameter:
-RawQuery String yes The RawQuery parameter switches the scope to advanced query mode. You use OPATH filter syntax for advanced query mode.
-Comment String The Comment parameter specifies an optional comment. If you specify a value that contains spaces, enclose the value in quotation marks ("), for example: "This is an admin note".

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