Skip to content

Commit 73f1a38

Browse files
000-356: updateitempermissions
1 parent 632c87d commit 73f1a38

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

articles/en/SharePointOnline/systemupdateitem.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Set-PnPListItem -List "Demo List" -Identity 1 -Values @{"Editor"="testuser@domai
5353
###### Updating the Title Field
5454

5555
```powershell
56-
Set-PnPListItem -List "Demo List" -Identity 1 -Values @{"Title"="New Title"} -UpdateType SystemUpdate
56+
Set-PnPListItem -List "Demo List" -Identity 1 -Values @{"Title"="New Title"} -UpdateType UpdateOverwriteVersion
5757
```
5858

5959
This command updates the "Title" field of the item without changing the "Modified" date.
@@ -64,7 +64,7 @@ This command updates the "Title" field of the item without changing the "Modifie
6464
###### Updating the Due Date Field
6565

6666
```powershell
67-
Set-PnPListItem -List "Demo List" -Identity 1 -Values @{"DueDate"="2024-12-31"} -UpdateType SystemUpdate
67+
Set-PnPListItem -List "Demo List" -Identity 1 -Values @{"DueDate"="2024-12-31"} -UpdateType UpdateOverwriteVersion
6868
```
6969

7070
Here, the "DueDate" field is updated without altering the "Modified" date.
@@ -76,7 +76,7 @@ Here, the "DueDate" field is updated without altering the "Modified" date.
7676
###### Updating Multiple Fields Simultaneously
7777

7878
```powershell
79-
Set-PnPListItem -List "Demo List" -Identity 1 -Values @{"Title"="Updated Title"; "Status"="Completed"; "Priority"="High"} -UpdateType SystemUpdate
79+
Set-PnPListItem -List "Demo List" -Identity 1 -Values @{"Title"="Updated Title"; "Status"="Completed"; "Priority"="High"} -UpdateType UpdateOverwriteVersion
8080
```
8181

8282
This command updates the "Title," "Status," and "Priority" fields all at once, again without modifying the "Modified" date.
@@ -106,6 +106,8 @@ Set-PnPListItem -List "Demo List" -Identity 1 -Values @{"Editor"="testuser@domai
106106
-UpdateType SystemUpdate: This parameter ensures that the update is applied to the existing version of the item without creating a new version. The event or workflow associated with the item is triggered, though.
107107

108108

109+
<br/><br/><br/>
110+
109111
# Update batch items
110112

111113
If you need to update multiple list items in one go, you can do so by combining the `Set-PnPListItem` and `New-PnPBatch` cmdlets. Here's an example of how to batch update several items:
@@ -133,17 +135,41 @@ Invoke-PnPBatch -Batch $batch
133135

134136
`Set-PnPListItem -List "Demo List" -Identity $item.Id -Values @{"Status"="Archived"; "Reviewed"="Yes"} -UpdateType SystemUpdate -Batch $batch`: For each item, this command updates the "Status" to "Archived" and the "Reviewed" field to "Yes," without changing the "Modified" date or creating a new version.
135137

138+
139+
<br/><br/><br/>
140+
141+
# Set-PnPImageListItemColumn
142+
Image column can be updated using `Set-PnPImageListItemColumn`. The cmdlet also takes [-UpdateType <UpdateType>] parameter.
143+
144+
145+
### Example 1
146+
Using the following example you can set the image value in the field without updating the Modified Date, the Modified By, or triggering a workflow.
147+
148+
`Set-PnPImageListItemColumn -List "Demo List" -Identity 1 -Field "Thumbnail" -ServerRelativePath "/sites/contoso/SiteAssets/test.png" -UpdateType UpdateOverwriteVersion`
149+
150+
151+
### Example 2
152+
Using the following example you can set the image value in the field and trigger the workflow or event associated with the list item. The Modified Date and the Modified By will not be updated.
153+
154+
`Set-PnPImageListItemColumn -List "Demo List" -Identity 1 -Field "Thumbnail" -ServerRelativePath "/sites/contoso/SiteAssets/test.png" -UpdateType SystemUpdate`
155+
156+
157+
<br/><br/><br/>
158+
136159
# Update item permissions
137160

138161

139162

140163

141-
Set-PnPImageListItemColumn
164+
<br/><br/><br/>
142165

143166
# Important Considerations
167+
144168
Auditability: Be cautious when using this approach, as it overwrites the current version, potentially losing track of changes that might be important for auditing purposes.
169+
145170
User Awareness: Ensure that users are aware of when and why this method is used, as it deviates from the usual behavior of versioning in SharePoint.
146171

172+
<br/><br/><br/>
147173

148174
# See Also
149175

0 commit comments

Comments
 (0)