Skip to content

Commit

Permalink
Merge pull request #4562 from KoenZomers/CopilotAdminLimitedModeCmdlets
Browse files Browse the repository at this point in the history
Added `Get-PnPCopilotAdminLimitedMode` and `Set-PnPCopilotAdminLimitedMode`
  • Loading branch information
erwinvanhunen authored Nov 26, 2024
2 parents d800c59 + 0c7b335 commit 05ca190
Show file tree
Hide file tree
Showing 6 changed files with 240 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `Add-PnPFileSensitivityLabel` which allows for assigning sensitivity labels to SharePoint files [#4538](https://github.com/pnp/powershell/pull/4538)
- Added `-CanSyncHubSitePermissions` parameter to `Set-PnPSite` cmdlet to set value of allowing syncing hub site permissions to this associated site.
- Added `Get-PnPProfileCardProperty`, `New-PnPProfileCardProperty` and `Remove-PnPProfileCardProperty` cmdlets to manage showing additional properties on the Microsoft 365 user profile [#4548](https://github.com/pnp/powershell/pull/4548)
- Added `Get-PnPCopilotAdminLimitedMode` and `Set-PnPCopilotAdminLimitedMode` which allows for managing the setting that controls whether Microsoft 365 Copilot in Teams Meetings users can receive responses to sentiment-related prompts [#4562](https://github.com/pnp/powershell/pull/4562)
- Added `-Contributors` and `-Managers` parameters to `New-PnPTermGroup` and `Set-PnPTermGroup` cmdlets.
- Added `-Files` parameter for `Send-PnPMail` cmdlet to allow files to be downloaded from SharePoint and then sent as attachments.

Expand Down
70 changes: 70 additions & 0 deletions documentation/Get-PnPCopilotAdminLimitedMode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
Module Name: PnP.PowerShell
schema: 2.0.0
applicable: SharePoint Online
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPCopilotAdminLimitedMode.html
external help file: PnP.PowerShell.dll-Help.xml
title: Get-PnPCopilotAdminLimitedMode
---

# Get-PnPCopilotAdminLimitedMode

## SYNOPSIS

**Required Permissions**

* Microsoft Graph API: CopilotSettings-LimitedMode.Read or CopilotSettings-LimitedMode.ReadWrite as delegated permission. Application permission not supported.

Returns the current configuration if Copilot in Teams Meetings should respond to sentiment related prompts.

## SYNTAX

```powershell
Get-PnPCopilotAdminLimitedMode [-Verbose] [-Connection <PnPConnection>]
```
## DESCRIPTION

Returns a setting that controls whether Microsoft 365 Copilot in Teams Meetings users can receive responses to sentiment-related prompts. If this setting is enabled, Copilot in Teams Meetings doesn't respond to sentiment-related prompts and questions asked by the user. If the setting is disabled, Copilot in Teams Meetings responds to sentiment-related prompts and questions asked by the user. Copilot in Teams Meetings currently honors this setting. By default, the setting is disabled.

## EXAMPLES

### EXAMPLE 1
```powershell
Get-PnPCopilotAdminLimitedMode
```

This cmdlet will return the current configuration if Copilot in Teams Meetings should respond to sentiment related prompts.

## PARAMETERS

### -Connection
Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing [Get-PnPConnection](Get-PnPConnection.md).

```yaml
Type: PnPConnection
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Verbose
When provided, additional debug statements will be shown while executing the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
## RELATED LINKS
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
[Microsoft Graph documentation](https://learn.microsoft.com/graph/api/copilotadminlimitedmode-get)
88 changes: 88 additions & 0 deletions documentation/Set-PnPCopilotAdminLimitedMode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
Module Name: PnP.PowerShell
schema: 2.0.0
applicable: SharePoint Online
online version: https://pnp.github.io/powershell/cmdlets/Set-PnPCopilotAdminLimitedMode.html
external help file: PnP.PowerShell.dll-Help.xml
title: Set-PnPCopilotAdminLimitedMode
---

# Set-PnPCopilotAdminLimitedMode

## SYNOPSIS

**Required Permissions**

* Microsoft Graph API: CopilotSettings-LimitedMode.ReadWrite as delegated permission. Application permission not supported.

Allows configuring whether Copilot in Teams Meetings should respond to sentiment related prompts.

## SYNTAX

```powershell
Set-PnPCopilotAdminLimitedMode -IsEnabledForGroup <boolean> -GroupId <String> [-Verbose] [-Connection <PnPConnection>]
```
## DESCRIPTION

Represents a setting that controls whether Microsoft 365 Copilot in Teams Meetings users can receive responses to sentiment-related prompts. If this setting is enabled, Copilot in Teams Meetings doesn't respond to sentiment-related prompts and questions asked by the user. If the setting is disabled, Copilot in Teams Meetings responds to sentiment-related prompts and questions asked by the user. Copilot in Teams Meetings currently honors this setting. By default, the setting is disabled.

## EXAMPLES

### EXAMPLE 1
```powershell
Set-PnPCopilotAdminLimitedMode -IsEnabledForGroup:$true -GroupId 32b5ad0f-b502-4083-9d01-0f192f15b2b6
```

This cmdlet will prevent Copilot in Teams Meetings from responding to sentiment related prompts for the specified group.

### EXAMPLE 2
```powershell
Set-PnPCopilotAdminLimitedMode -IsEnabledForGroup:$false
```

This cmdlet will allow Copilot in Teams Meetings to respond to sentiment related prompts for everyone.

## PARAMETERS

### -Connection
Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing [Get-PnPConnection](Get-PnPConnection.md).

```yaml
Type: PnPConnection
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -IsEnabledForGroup
Enables the user to be in limited mode for Copilot in Teams meetings. When enabled, users in this mode can ask any questions, but Copilot doesn't respond to certain questions related to inferring emotions, behavior, or judgments. When disabled, the current mode for Copilot, it responds to any types of questions grounded to the meeting conversation. The default value is false.
```yaml
Type: Boolean
Parameter Sets: (All)
Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -GroupId
The ID of a Microsoft Entra group, of which the value of IsEnabledForGroup is applied value for its members. The default value is null. This parameter is optional. If isEnabledForGroup is set to true, the groupId value must be provided for the IsEnabledForGroup to be enabled for the members of the group.
```yaml
Type: String
Parameter Sets: (All)
Required: False
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
## RELATED LINKS
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
[Microsoft Graph documentation](https://learn.microsoft.com/graph/api/copilotadminlimitedmode-update)
20 changes: 20 additions & 0 deletions src/Commands/Copilot/GetCopilotAdminLimitedMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Attributes;
using System.Management.Automation;

namespace PnP.PowerShell.Commands.Copilot
{
[Cmdlet(VerbsCommon.Get, "PnPCopilotAdminLimitedMode")]
[RequiredApiDelegatedPermissions("graph/CopilotSettings-LimitedMode.Read")]
[RequiredApiDelegatedPermissions("graph/CopilotSettings-LimitedMode.ReadWrite")]
[ApiNotAvailableUnderApplicationPermissions]
[OutputType(typeof(Model.Graph.Copilot.CopilotAdminLimitedMode))]
public class GetCopilotAdminLimitedMode : PnPGraphCmdlet
{
protected override void ExecuteCmdlet()
{
var result = Utilities.REST.GraphHelper.Get<Model.Graph.Copilot.CopilotAdminLimitedMode>(this, Connection, "beta/copilot/admin/settings/limitedMode", AccessToken);
WriteObject(result, false);
}
}
}
38 changes: 38 additions & 0 deletions src/Commands/Copilot/SetCopilotAdminLimitedMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System.Management.Automation;
using PnP.PowerShell.Commands.Attributes;
using PnP.PowerShell.Commands.Base;
using System.Net.Http.Json;

namespace PnP.PowerShell.Commands.Copilot
{
[Cmdlet(VerbsCommon.Set, "PnPCopilotAdminLimitedMode")]
[RequiredApiDelegatedOrApplicationPermissions("graph/CopilotSettings-LimitedMode.ReadWrite")]
[OutputType(typeof(Model.Graph.Copilot.CopilotAdminLimitedMode))]
public class SetCopilotAdminLimitedMode : PnPGraphCmdlet
{
[Parameter(Mandatory = true)]
public bool IsEnabledForGroup;

[Parameter(Mandatory = false)]
public string GroupId;

protected override void ExecuteCmdlet()
{
if(IsEnabledForGroup && string.IsNullOrEmpty(GroupId))
{
throw new PSArgumentException($"{nameof(GroupId)} is required when {nameof(IsEnabledForGroup)} is set to true", nameof(GroupId));
}

var bodyContent = new Model.Graph.Copilot.CopilotAdminLimitedMode
{
GroupId = GroupId,
IsEnabledForGroup = IsEnabledForGroup
};
var jsonContent = JsonContent.Create(bodyContent);
WriteVerbose($"Payload: {jsonContent.ReadAsStringAsync().GetAwaiter().GetResult()}");

var result = Utilities.REST.GraphHelper.Patch<Model.Graph.Copilot.CopilotAdminLimitedMode>(this, Connection, AccessToken, "beta/copilot/admin/settings/limitedMode", jsonContent);
WriteObject(result, false);
}
}
}
23 changes: 23 additions & 0 deletions src/Commands/Model/Graph/Copilot/CopilotAdminLimitedMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Text.Json.Serialization;

namespace PnP.PowerShell.Commands.Model.Graph.Copilot
{
/// <summary>
/// Contains a profile card property information
/// </summary>
/// <remarks>See https://learn.microsoft.com/graph/api/copilotadminlimitedmode-get</remarks>
public class CopilotAdminLimitedMode
{
/// <summary>
/// The ID of a Microsoft Entra group to which the value of the isEnabledForGroup property is applied value. If NULL, it applies to all users.
/// </summary>
[JsonPropertyName("groupId")]
public string GroupId { get; set; }

/// <summary>
/// Boolean indicating if the user to be in limited mode for Copilot in Teams meetings is enabled
/// </summary>
[JsonPropertyName("isEnabledForGroup")]
public bool IsEnabledForGroup { get; set; }
}
}

0 comments on commit 05ca190

Please sign in to comment.