Replies: 1 comment 1 reply
-
Mostly, I was misinterpreting where I would see the label. The command is working and you can see it on the files within the folders so my mistake. I was looking at the folder itself which doesn't show the label. I can't however use Further details have been posted on this Github Issue. I am attempting the below method ...
This again doesn't seem to set a label on the folder in a way that would allow the contents of the folder to have a diferent label from the root "Documents" or "Shared Documents" folder. |
Beta Was this translation helpful? Give feedback.
-
Set-PnPlabel has the following description:
"Sets a retention label on the specified list or library"
Having authenticated to both SPO sites & OneDrive for Business sites I am trying to apply labels within document libraries but with no success. My authentication methods use both Global admin using MFA and a service principal configured with a self signed certificate. Connect-PnPOnline is used to connect.
I have pre-configured Labels and Policies so I would have expected the following 2 commands to apply the label after having successfully created some target folders using Add-PnPFolder, within OD4B & SPO Site.
Working well:
OD4B -
Add-PnPFolder -Name "Test Folder 12345" -Folder "Documents"
SPO -
Add-PnPFolder -Name "Test Folder 12345" -Folder "Shared Documents"
Not working:OD4B -Set-PnPLabel -List "Documents/Test Folder 12345" -Label "Test"
SPO -Set-PnPLabel -List "Shared Documents/Test Folder 12345" -Label "Test"
I see other blogs and others online (not many though) indicating that they have these Cmdlets working. When I run these commands, even with the verbose switch I get no feedback so it looks to have applied. The label does not apply however.This issue here may or may not be related but I thought I'd link it. I am not using the SyncToItems switch.Can any other get success usingSet-PnPLabel
? Am I perhaps doing it wrong or are there issues that I am overlooking?NB: Now I have noticed the labels applying and visible on files within folder. Is there a way to use PnP to set a label on a sub folder of Documents in OneDrive or a sub folder of Shared Documents in SharePoint Online?
Further details have been posted on this Github Issue.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions