Commands › SharePoint Online

Update-SPODataEncryptionPolicy

SharePoint Online Microsoft.Online.SharePoint.PowerShell Update-*

Updates customer encryption status for a geo tenant.

Quick start script

# Update-SPODataEncryptionPolicy — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-SPOService -Url https://$org-admin.sharepoint.com

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-SPODataEncryptionPolicy
$before | Format-List

# 3. Make the change (dry run first)
Update-SPODataEncryptionPolicy -KeyName <String> -KeyType <CustomerKeyVaultKeyType> -KeyVaultName <String> -WhatIf
Update-SPODataEncryptionPolicy -KeyName <String> -KeyType <CustomerKeyVaultKeyType> -KeyVaultName <String>

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

Syntax — 2 parameter sets

BYOK_MultipleParameters (Default)

Update-SPODataEncryptionPolicy -KeyVaultName <String> -KeyName <String> -KeyVersion <Guid>
 -KeyType <CustomerKeyVaultKeyType> [-WhatIf] [-Confirm] [<CommonParameters>]

BYOK_Uri

Update-SPODataEncryptionPolicy -KeyVaultUri <Uri> -KeyType <CustomerKeyVaultKeyType> [-WhatIf] [-Confirm]
 [<CommonParameters>]

Parameters (7)

ParameterTypeRequiredWhat it controls
-KeyName String yes The name of the key
-KeyType CustomerKeyVaultKeyType yes The type of the key, possible values are
-KeyVaultName String yes The name of the Azure Key Vault Name
-KeyVaultUri Uri yes The Uri of the Azure Key Vault
-KeyVersion Guid yes The version of the key
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-WhatIf SwitchParameter Shows what would happen if the cmdlet runs. The cmdlet is not run.

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