Commands › Exchange Online

Set-OrganizationSegment

Exchange Online ExchangeOnlineManagement Set-*

For more information, see Security & Compliance PowerShell. Use the Set-OrganizationSegment cmdlet to modify organization segments in the Microsoft Purview compliance portal. Organization Segments are not in effect until you apply information barrier policies.

Quick start script

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

# 3. Make the change
Set-OrganizationSegment

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

Syntax

Set-OrganizationSegment [-Identity] <PolicyIdParameter>
 [-UserGroupFilter <String>]
 [<CommonParameters>]

Parameters (2)

ParameterTypeRequiredWhat it controls
-Identity PolicyIdParameter The Identity parameter specifies the organization segment that you want to modify. You can use any value that uniquely identifies the segment. For example:
-UserGroupFilter String The UserGroupFilter parameter uses OPATH filter syntax to specify the members of the organization segment. The syntax is `"Property -ComparisonOperator 'Value'"` (for example, `"MemberOf -eq 'Engineering...

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