Commands › Exchange Online

Set-M365DataAtRestEncryptionPolicyAssignment

Exchange Online ExchangeOnlineManagement Set-*

Assign a Microsoft 365 data-at-rest encryption policy at the tenant level.

Quick start script

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

# 3. Make the change
Set-M365DataAtRestEncryptionPolicyAssignment -DataEncryptionPolicy <DataEncryptionPolicyIdParameter>

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

Syntax

Set-M365DataAtRestEncryptionPolicyAssignment -DataEncryptionPolicy <DataEncryptionPolicyIdParameter> [<CommonParameters>]

Parameters (1)

ParameterTypeRequiredWhat it controls
-DataEncryptionPolicy DataEncryptionPolicyIdParameter yes The DataEncryptionPolicy parameter specifies the Microsoft 365 data-at-rest encryption policy. You can use any value that uniquely identifies the policy. For example:

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