-
Notifications
You must be signed in to change notification settings - Fork 352
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
New cmdlet to unlock list item #4457
base: dev
Are you sure you want to change the base?
Conversation
hey @reshmee011 , instead of this CSOM based API request , let's use the graph based one: Can you modify the PR to do that ? |
@gautamdsheth : Sure I can do that, I will make the changes soon. |
@gautamdsheth : Is there any existing function to retrieve the driveid of the list or library from Graph? |
Hi @reshmee011 , we use PnP Core for this. Check this :
Maybe we can use the VroomDriveId I think. Also, I think the value is same as list GUID value AFAIK, need to check , so list.ID or list.GUID might work |
@gautamdsheth : Thanks for the guidance. I have not tested it yet, will |
@gautamdsheth : I have used the REST API endpoint /_api/SP.CompliancePolicy.SPPolicyStoreProxy.UnlockRecordItem() which works for both a file and list item. The Graph endpoint works against a driveitem which from my understanding is applicable only to a file. I bet another cmdlet Unlock-PnPFile would work for the Graph endpoint https://learn.microsoft.com/en-us/graph/api/driveitem-lockorunlockrecord?view=graph-rest-1.0&tabs=http |
Hmm, need to check this a bit about how to fetch driveId via PnP Core. Will get back to you asap. |
@reshmee011 - we can fetch the Drive ID and Drive ItemID as below:
We can then use these values in the Graph patch request |
@gautamdsheth :Thank you. Shall I also update the cmdlet to Unlock-PnPFileRecord to reflect that it will be applicable to files and not to list items.? |
Maybe lets call it |
@gautamdsheth : There is another endpoint to update retention label https://learn.microsoft.com/en-us/graph/api/driveitem-setretentionlabel?view=graph-rest-1.0&tabs=http, I can implement is as Update-PnPFileRetentionLabel. For this one which refers , shall I keep as Unlock-PnPFileRecord with a switchparameter to lock the record? |
Both of them are point to the same Graph endpoint with different payloads. |
Sounds good, I will have a go at it and reiterate with further changes. |
c6c5e9a
to
89edb71
Compare
Type
What is in this Pull Request ?
Files related to new cmdlet to unlock a list item
-src\Commands\Lists\UnlockListItemRecord.cs