$web = Get-SPWeb http://<site>/Ringo
$list = $web.Lists["Shared Documents"]
$item = $list.GetItemById(171)
$file = $item.File
$file
$userId = $file.LockedByUser.ID
$user = $web.AllUsers.GetByID($userId)
$impSite= New-Object Microsoft.SharePoint.SPSite($web.Url, $user.UserToken);
$impWeb = $impSite.OpenWeb();
$impList = $impWeb.Lists[$list.Title]
$impItem = $impList.GetItemById($item.ID)
$impFile = $impItem.File
$impFile.ReleaseLock($impFile.LockId)
Technorati Tags: SharePoint,unlock file,powershell,shortterm lock,long term lock,SharePoint 2010,SharePoint 2013
No comments:
Post a Comment