From 5802f4ea3edf3e7383e46645d2b10b7926ee4df2 Mon Sep 17 00:00:00 2001 From: Gautam Sheth Date: Mon, 22 Sep 2025 11:04:48 +0300 Subject: [PATCH] Add KnowledgeAgentEnabled parameter to Set-PnPTenant cmdlet --- documentation/Set-PnPTenant.md | 15 +++++++++++++++ src/Commands/Admin/SetTenant.cs | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/documentation/Set-PnPTenant.md b/documentation/Set-PnPTenant.md index f72dd275b..7fde9a05f 100644 --- a/documentation/Set-PnPTenant.md +++ b/documentation/Set-PnPTenant.md @@ -2569,6 +2569,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -KnowledgeAgentEnabled + +Enables or disables the Knowledge Agent feature tenant-wide. When set to $true, the Knowledge Agent functionality is enabled for the tenant; when set to $false it is disabled. Use this parameter to control tenant-level Knowledge Agent behavior. + +```yaml +Type: Boolean +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -AllowSensitivityLabelOnRecords Allows sensitivity label on records. diff --git a/src/Commands/Admin/SetTenant.cs b/src/Commands/Admin/SetTenant.cs index 34da0624a..e8f182095 100644 --- a/src/Commands/Admin/SetTenant.cs +++ b/src/Commands/Admin/SetTenant.cs @@ -429,6 +429,9 @@ public class SetTenant : PnPSharePointOnlineAdminCmdlet [Parameter(Mandatory = false)] public bool? AIBuilderEnabled { get; set; } + [Parameter(Mandatory = false)] + public bool? KnowledgeAgentEnabled { get; set; } + [Parameter(Mandatory = false)] public bool? AllowSensitivityLabelOnRecords { get; set; } @@ -1668,6 +1671,11 @@ protected override void ExecuteCmdlet() Tenant.DelayDenyAddAndCustomizePagesEnforcementOnClassicPublishingSites = DelayDenyAddAndCustomizePagesEnforcementOnClassicPublishingSites.Value; modified = true; } + if (KnowledgeAgentEnabled.HasValue) + { + Tenant.KnowledgeAgentEnabled = KnowledgeAgentEnabled.Value; + modified = true; + } if (GuestSharingGroupAllowListInTenantByPrincipalIdentity != null) { if (GuestSharingGroupAllowListInTenantByPrincipalIdentity.Length > 0)