-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4562 from KoenZomers/CopilotAdminLimitedModeCmdlets
Added `Get-PnPCopilotAdminLimitedMode` and `Set-PnPCopilotAdminLimitedMode`
- Loading branch information
Showing
6 changed files
with
240 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
23
src/Commands/Model/Graph/Copilot/CopilotAdminLimitedMode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |