Skip to main content

unlock locked items in path

Given an owner, path to search and a keyword, this script will recursively search and unlock any items that are found.

$pathToSearch = 'master:/sitecore/content/MyWebsite/Home/'
$ownerToFind = 'sitecore\[email protected]'
$pathContains = 'Nested folder'

Get-ChildItem $pathToSearch -rec -Language * |
Where-Object { ($_.Locking.GetOwner() -eq $ownerToFind) -and ($_.Paths.FullPath -Match $pathContains) } |
% { $_.Locking.Unlock() }