Sitecore Powershell script to unlock all locked items in Sitecore

By Pranay
16 May '20  ·  2635 views

This post provides Sitecore PowerShell script to unlock all items locked in Sitecore by content authors.

If you are looking for a way to unlock all the items which are locked in Sitecore then here is the solution. This PowerShell script goes through all the items under a root node and unlocks them if they are locked.

Is this not the script you are looking for? Then check the complete list of Sitecore Powershell scripts

Sitecore Powershell script to unlock all locked items

$sourcePath = "/sitecore/content/Site1/Home"
function RunScript
    $items = Get-ChildItem -Path $sourcePath -Recurse
    $rootItem = Get-Item -Path $sourcePath
    $items = $items + $rootItem

    foreach ($item in $items)
        foreach ($version in $item.Versions.GetVersions($true))
                Write-Host "Item un-locked:" $item.ID $version.Language;

$items = RunScript

Unlock Items PowerShell

About the author

Pranay Deegoju
Sitecore Certified Professional

A Software Engineer by profession, a part time blogger and an enthusiast programmer. You can find more about me here.

Post a comment

Recent Posts


Liked this article?

Subscribe with your email and get updates when ever a new article is posted.

By subscribing you agree to our privacy terms. We promise that we do not sell your data.