Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Set-PnPComplianceTagOnBulkItems cmdlet #3599

Merged
Merged
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `Restore-PnPDeletedContainer` cmdlet which recovers a deleted Container from the Recycle Bin. [#3661](https://github.com/pnp/powershell/pull/3661)
- Added `Get-PnPWebPermission` cmdlet which retrieves permission given by user for specific web. [#3685](https://github.com/pnp/powershell/pull/3685)
- Added `-HorizontalQuickLaunch` parameter to `Set-PnPWeb` cmdlet to allow navigation orientation to be horizontal. [#3722](https://github.com/pnp/powershell/pull/3722)
- Added `Set-PnPRetentionLabel` and `Reset-PnPRetentionLabel` cmdlets to support setting a retention label on one or more items [#3599](https://github.com/pnp/powershell/pull/3599)

### Fixed

Expand All @@ -43,6 +44,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

### Contributors

- Konrad K. [wilecoyotegenius]
- Leon Armston [LeonArmston]
- Daniel Cecil [danielcecil]
- Rohit Devmore [rohit404404]
Expand Down Expand Up @@ -99,10 +101,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added support for executing the 'Invoke-PnPSPRestMethod' cmdlet in a batch [#3565](https://github.com/pnp/powershell/pull/3565)
- Added `Get-PnPSiteSetVersionPolicyProgress` cmdlet which allows for getting the progress of setting a version policy for existing document libraries on a site [#3564](https://github.com/pnp/powershell/pull/3564)
- Added `EnableSensitivityLabelForPDF` to `Set-PnPTenant` and `Get-PnPTenant` [#3581](https://github.com/pnp/powershell/pull/3581)
- Changed `Restore-PnPRecycleBinItem` , made `-Identity` parameter as non-mandatory. [#2499](https://github.com/pnp/powershell/pull/2499)
- Added the ability to set Manage and FullControl permissions directly when using Sites.Selected with `Grant-PnPAzureADAppSitePermission` [#3617](https://github.com/pnp/powershell/pull/3617)
- Added `Remove-PnPMicrosoft365GroupPhoto` cmdlet which allows removal of profile picture of M365 Group. [#3607](https://github.com/pnp/powershell/pull/3607)


### Fixed

- Fixed `Add-PnPContentTypeToList` cmdlet to better handle piped lists. [#3244](https://github.com/pnp/powershell/pull/3244)
Expand Down Expand Up @@ -455,7 +457,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Improved `Remove-PnPFieldFromContentType` cmdlet to ensure proper null check for non-existing fields. It will now throw proper `Field not found` error. [#2407](https://github.com/pnp/powershell/pull/2407)
- Changed the Microsoft 365 Groups cmdlets to use the `v1.0` endpoint instead of the `beta` [#2426](https://github.com/pnp/powershell/pull/2426)
- Changed `Add-PnPMicrosoft365GroupToSite` to longer require the `-Url` parameter to be specified. If its not provided, the currently connected to site will be groupified. [#2496](https://github.com/pnp/powershell/pull/2496)
- Changed `Restore-PnPRecycleBinItem` , made `-Identity` parameter as non-mandatory. [#2499](https://github.com/pnp/powershell/pull/2499)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title: Get-PnPRetentionLabel
# Get-PnPRetentionLabel

## SYNOPSIS
Gets the Microsoft Purview retention labels that are within the tenant
Gets the Microsoft Purview retention labels that are available within the tenant

## SYNTAX

Expand Down
90 changes: 0 additions & 90 deletions documentation/Reset-PnPLabel.md

This file was deleted.

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

# Reset-PnPRetentionLabel

## SYNOPSIS
Resets a retention label on the specified list or library to None, or resets a retention label on specified list items in a list or a library

## SYNTAX

### Reset on a list
```powershell
Reset-PnPRetentionLabel [-List] <ListPipeBind> [-SyncToItems <Boolean>]
[-Connection <PnPConnection>]
```

### Reset on items in bulk
```powershell
Reset-PnPRetentionLabel [-List] <ListPipeBind> -ItemIds <List<Int32>> [-BatchSize <Int32>]
[-Connection <PnPConnection>] [-Verbose]
```

## DESCRIPTION
Removes the retention label on a list or library and its items, or removes the retention label from specified items in a list or a library. Does not work for sensitivity labels.
When resetting retention label on specified items, cmdlet allows passing of unlimited number of items - items will be split and processed in batches (CSOM method SetComplianceTagOnBulkItems has a hard count limit on number of processed items in one go). If needed, batch size may be adjusted with BatchSize parameter.

## EXAMPLES

### EXAMPLE 1
```powershell
Reset-PnPRetentionLabel -List "Demo List"
```

This resets an O365 label on the specified list or library to None

### EXAMPLE 2
```powershell
Reset-PnPRetentionLabel -List "Demo List" -SyncToItems $true
```

This resets an O365 label on the specified list or library to None and resets the label on all the items in the list and library except Folders and where the label has been manually or previously automatically assigned

### EXAMPLE 3
```powershell
Set-PnPRetentionLabel -List "Demo List" -ItemIds @(1,2,3)
```

This clears a retention label from items with ids 1, 2 and 3 on a list "Demo List"

## PARAMETERS

### -BatchSize
Optional batch size when resetting a label on specified items.

```yaml
Type: Int32
Parameter Sets: (BulkItems)

Required: True
Position: Named
Default value: 25
Accept pipeline input: False
Accept wildcard characters: False
```

### -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.

```yaml
Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ItemIds
List of iist item IDs to reset label.

```yaml
Type: List<Int32>
Parameter Sets: (BulkItems)

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -List
The ID or Url of the list

```yaml
Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### -SyncToItems
Reset label on existing items in the library

```yaml
Type: Boolean
Parameter Sets: (List)

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 Learn article on applying retention labels](https://learn.microsoft.com/en-us/sharepoint/dev/apis/csom-methods-for-applying-retention-labels)


Loading
Loading