## Delegated Administration with SPE Let's say for example that you wanted to provide a *Context Menu* option for users to unlock items based on the following criteria. * **Show** when User is in the **sitecore\Delegated Admin** role * **Enable** when the item is **locked** In between cooking eggs at home I was able to whip this up. [![Unlock Elevated Context Menu][1]][1] ### So here is how I built it. 1. Create a new SPE Module with a **Context Menu** library. 2. Create a new script for unlocking the selected item. 3. Configure a rule for **Show** and **Enable** when certain conditions are met. [![Script with Rules][2]][2] Now the user is able to *Lock and Edit*. [![Lock and Edit][3]][3] Sample script for *Unlock Elevated*: <!-- language: lang-powershell --> $item = Get-Item -Path . # The user should be one granted the appropriate access. $user = Get-User -Id "superuser" New-UsingBlock (New-Object Sitecore.Security.Accounts.UserSwitcher $user) { $item | Unlock-Item } **Note:** This solution may be better suited as a **Ribbon** command. You can read more about how to do that [here][4]. [![Unlock Elevated Ribbon][5]][5] [1]: https://i.sstatic.net/n7cSE.png [2]: https://i.sstatic.net/1Vdaw.png [3]: https://i.sstatic.net/p3I3k.png [4]: https://sitecorepowershell.gitbooks.io/sitecore-powershell-extensions/content/content-editor.html [5]: https://i.sstatic.net/7eBh5.png