Commands › Exchange Online

New-LabelPolicy

Exchange Online ExchangeOnlineManagement New-*

For more information, see Security & Compliance PowerShell. Use the New-LabelPolicy cmdlet to create sensitivity label policies in your organization.

Quick start script

# New-LabelPolicy — 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-LabelPolicy
$before | Format-List

# 3. Make the change (dry run first)
New-LabelPolicy -Name <String> -Labels <MultiValuedProperty> -WhatIf
New-LabelPolicy -Name <String> -Labels <MultiValuedProperty>

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

Syntax

New-LabelPolicy -Name <String> -Labels <MultiValuedProperty>
 [-AdvancedSettings <PswsHashtable>]
 [-Comment <String>]
 [-Confirm]
 [-ExchangeAdaptiveScopes <MultiValuedProperty>]
 [-ExchangeAdaptiveScopesException <MultiValuedProperty>]
 [-ExchangeLocation <MultiValuedProperty>]
 [-ExchangeLocationException <MultiValuedProperty>]
 [-Force]
 [-MigrationId <String>]
 [-ModernGroupLocation <MultiValuedProperty>]
 [-ModernGroupLocationException <MultiValuedProperty>]
 [-OneDriveLocation <MultiValuedProperty>]
 [-OneDriveLocationException <MultiValuedProperty>]
 [-PolicyRBACScopes <MultiValuedProperty>]
 [-PublicFolderLocation <MultiValuedProperty>]
 [-Setting <PswsHashtable>]
 [-Settings <PswsHashtable>]
 [-SharePointLocation <MultiValuedProperty>]
 [-SharePointLocationException <MultiValuedProperty>]
 [-SkypeLocation <MultiValuedProperty>]
 [-SkypeLocationException <MultiValuedProperty>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (24)

ParameterTypeRequiredWhat it controls
-Name String yes The Name parameter specifies the unique name for the policy. The maximum length is 64 characters. If the value contains spaces, enclose the value in quotation marks (").
-Labels MultiValuedProperty yes The Labels parameter specifies the sensitivity labels that are associated with the policy. You can use any value that uniquely identifies the label. For example:
-AdvancedSettings PswsHashtable The AdvancedSettings parameter enables client-specific features and capabilities for the sensitivity label policy.
-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".
-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.
-ExchangeAdaptiveScopes MultiValuedProperty {{ Fill ExchangeAdaptiveScopes Description }}
-ExchangeAdaptiveScopesException MultiValuedProperty {{ Fill ExchangeAdaptiveScopesException Description }}
-ExchangeLocation MultiValuedProperty The ExchangeLocation parameter specifies the mailboxes to include in the policy. A valid value is a mailbox.
-ExchangeLocationException MultiValuedProperty The ExchangeLocationException parameter specifies the mailboxes to exclude when you use the value All for the ExchangeLocation parameter. A valid value is a mailbox.
-Force SwitchParameter The Force switch hides warning or confirmation messages. You don't need to specify a value with this switch.
-MigrationId String This parameter is reserved for internal Microsoft use.
-ModernGroupLocation MultiValuedProperty The ModernGroupLocation parameter specifies the Microsoft 365 Groups to include in the policy. To identify the Microsoft 365 Group, you must use the primary SMTP address.
-ModernGroupLocationException MultiValuedProperty This parameter is reserved for internal Microsoft use.
-OneDriveLocation MultiValuedProperty This parameter is reserved for internal Microsoft use.
-OneDriveLocationException MultiValuedProperty This parameter is reserved for internal Microsoft use.
-PolicyRBACScopes MultiValuedProperty The PolicyRBACScopes parameter specifies the administrative units to assign to the policy. A valid value is the Microsoft Entra ObjectID (GUID value) of the administrative unit. You can specify multiple values...
-PublicFolderLocation MultiValuedProperty This parameter is reserved for internal Microsoft use.
-Setting PswsHashtable This parameter is reserved for internal Microsoft use.
-Settings PswsHashtable This parameter is reserved for internal Microsoft use.
-SharePointLocation MultiValuedProperty This parameter is reserved for internal Microsoft use.
-SharePointLocationException MultiValuedProperty This parameter is reserved for internal Microsoft use.
-SkypeLocation MultiValuedProperty This parameter is reserved for internal Microsoft use.
-SkypeLocationException MultiValuedProperty This parameter is reserved for internal Microsoft use.
-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.