Created
December 16, 2022 00:21
-
-
Save fluxdigital/991c766ec62f4e9abfcbd49dfdb03ebc to your computer and use it in GitHub Desktop.
Unlock Items for User - ChatGPT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set the username of the user whose locked items you want to unlock | |
$username = "admin" | |
# Get a list of all items locked by the specified user | |
$lockedItems = Get-ChildItem -Path "master:\" -Recurse | Where-Object { | |
$_.Locking.IsLocked -and $_.Locking.LockedBy -eq $username | |
} | |
# Unlock all items in the list | |
foreach ($item in $lockedItems) { | |
$item.Editing.Unlock() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment