jueves, 1 de septiembre de 2016

When a file can't be check-out / check-in or deleted because is locked from someone

Hello!

This is the time, when you can do magic via PowerShell..!

The PS script to unlock your file is this one:

$web = get-spweb "SITE URL"
$list = $web.Lists["LIST NAME "]
$item = $list.Items.GetItemById(DOCUMENT ID)
$item.File.ReleaseLock($item.File.LockId)
$web.Dispose()

ie:
$web = get-spweb "https://abcde.com/team/IT/SharePoint/"
$list = $web.Lists["Documents"]
$item = $list.Items.GetItemById(225)
$item.File.ReleaseLock($item.File.LockId)
$web.Dispose()

There are different ways to find the DOC ID, however the easy way is adding in your VIEW (list/library) the column named ID.

Cheers!

No hay comentarios:

Publicar un comentario