From 9fe60a93d4347b8158720447ade6f2f4bfc3b479 Mon Sep 17 00:00:00 2001 From: Gautam Sheth Date: Thu, 10 Sep 2026 10:45:47 +0300 Subject: [PATCH 1/2] Fix #5467: related to default column value / event receiver issue --- CHANGELOG.md | 1 + src/Commands/Lists/SetDefaultColumnValues.cs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35042d5dc..9b449a7d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Added ### Changed +- `Set-PnPDefaultColumnValues` no longer fails with a generic 'Error applying default column values' when SharePoint Online rejects registering the LocationBasedMetadataDefaultsReceiver event receiver on the library, which it does since September 2026. The values are now stored and a warning explains that SharePoint will not apply them to newly added items until the receiver can be registered. Requires the accompanying PnP Framework change. [#5467](https://github.com/pnp/powershell/issues/5467) - Telemetry in PnP PowerShell has been removed due to the costs of collecting the data didn't outweigh the benefits to the PnP PowerShell team to have insights into its usage. The involved cmdlets `Get-PnPPowerShellTelemetryEnabled`, `Enable-PnPPowerShellTelemetry` and `Disable-PnPPowerShellTelemetry` have been marked as deprecated and no longer function, but will stay in v3 for backwards compatibility with existing scripts. These cmdlets will be removed in the next v4 release. All versions of PnP PowerShell will no longer be able to submit telemetry. You might see background requests for this failing. This will not interfear with the normal execution of your PowerShell script. [#5460](https://github.com/pnp/powershell/pull/5460) ### Fixed diff --git a/src/Commands/Lists/SetDefaultColumnValues.cs b/src/Commands/Lists/SetDefaultColumnValues.cs index 2e02c0c17..560394d5b 100644 --- a/src/Commands/Lists/SetDefaultColumnValues.cs +++ b/src/Commands/Lists/SetDefaultColumnValues.cs @@ -74,6 +74,14 @@ protected override void ExecuteCmdlet() } IDefaultColumnValue defaultColumnValue = field.GetDefaultColumnValueFromField(ClientContext, Folder, Value); list.SetDefaultColumnValues(new List() { defaultColumnValue }); + + // SharePoint applies the stored defaults through this event receiver. PnP Framework registers it, but + // since September 2026 SharePoint Online rejects event receiver registration through CSOM, in which + // case the values are stored but never applied to newly added items (#5467) + if (list.GetEventReceiverByName("LocationBasedMetadataDefaultsReceiver ItemAdded") == null) + { + LogWarning("The default column values have been stored, but the 'LocationBasedMetadataDefaultsReceiver ItemAdded' event receiver could not be registered on the list, so SharePoint will not apply them to newly added items."); + } } else { From 1b6fba3aaf0cdcd2c13fd8e231bc05094436ccf1 Mon Sep 17 00:00:00 2001 From: Gautam Sheth Date: Thu, 10 Sep 2026 14:15:14 +0300 Subject: [PATCH 2/2] Fix `Set-PnPDefaultColumnValues` to handle SharePoint Online event receiver registration failure and provide a warning for stored default column values --- CHANGELOG.md | 2 +- src/Commands/Lists/SetDefaultColumnValues.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b449a7d2..3168c24df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Added ### Changed -- `Set-PnPDefaultColumnValues` no longer fails with a generic 'Error applying default column values' when SharePoint Online rejects registering the LocationBasedMetadataDefaultsReceiver event receiver on the library, which it does since September 2026. The values are now stored and a warning explains that SharePoint will not apply them to newly added items until the receiver can be registered. Requires the accompanying PnP Framework change. [#5467](https://github.com/pnp/powershell/issues/5467) - Telemetry in PnP PowerShell has been removed due to the costs of collecting the data didn't outweigh the benefits to the PnP PowerShell team to have insights into its usage. The involved cmdlets `Get-PnPPowerShellTelemetryEnabled`, `Enable-PnPPowerShellTelemetry` and `Disable-PnPPowerShellTelemetry` have been marked as deprecated and no longer function, but will stay in v3 for backwards compatibility with existing scripts. These cmdlets will be removed in the next v4 release. All versions of PnP PowerShell will no longer be able to submit telemetry. You might see background requests for this failing. This will not interfear with the normal execution of your PowerShell script. [#5460](https://github.com/pnp/powershell/pull/5460) ### Fixed +- `Set-PnPDefaultColumnValues` and `Invoke-PnPSiteTemplate` failing with 'Error applying default column values' since September 2026, because SharePoint Online rejects registering the LocationBasedMetadataDefaultsReceiver event receiver through CSOM. PnP Framework now registers it through REST. Should that also fail, the values are stored and `Set-PnPDefaultColumnValues` warns that SharePoint will not apply them to newly added items. Requires the accompanying PnP Framework change. [#5467](https://github.com/pnp/powershell/issues/5467) - Using UPNs with an apostrophe in it not working with `Remove-PnPUserProfile`, `Export-PnPUserProfile`, `Export-PnPUserInfo`, and `Remove-PnPUserInfo`. The apostrophe is now escaped in the API request. [#5459](https://github.com/pnp/powershell/pull/5459) ## [3.4.1] diff --git a/src/Commands/Lists/SetDefaultColumnValues.cs b/src/Commands/Lists/SetDefaultColumnValues.cs index 560394d5b..c41ba8279 100644 --- a/src/Commands/Lists/SetDefaultColumnValues.cs +++ b/src/Commands/Lists/SetDefaultColumnValues.cs @@ -76,8 +76,8 @@ protected override void ExecuteCmdlet() list.SetDefaultColumnValues(new List() { defaultColumnValue }); // SharePoint applies the stored defaults through this event receiver. PnP Framework registers it, but - // since September 2026 SharePoint Online rejects event receiver registration through CSOM, in which - // case the values are stored but never applied to newly added items (#5467) + // when SharePoint Online rejects the registration the values are stored yet never applied to newly + // added items, so make that visible (#5467) if (list.GetEventReceiverByName("LocationBasedMetadataDefaultsReceiver ItemAdded") == null) { LogWarning("The default column values have been stored, but the 'LocationBasedMetadataDefaultsReceiver ItemAdded' event receiver could not be registered on the list, so SharePoint will not apply them to newly added items.");