Skip to content

Instantly share code, notes, and snippets.

@fabianneve
Created February 9, 2018 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabianneve/87ca9599049bf27bb66b24596ebd967a to your computer and use it in GitHub Desktop.
Save fabianneve/87ca9599049bf27bb66b24596ebd967a to your computer and use it in GitHub Desktop.
Clear short term file lock of a file in a SharePoint 2013+ document library. Replace url, list (List Title) and item ID.
$web = get-spweb "https://domain/sitecollection/site"
$list = $web.Lists["Documents"]
$item = $list.Items.GetItemById(123)
$item.File.ReleaseLock($item.File.LockId)
$web.Dispose()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment