SCCM – Fix Hung/Locked Task

email me

If you’re editing a task sequence or package, sometimes the DB record will be locked—-so that you can’t edit it. This happens when the console crashes or the particular instance you’re in crashes. Until the record lock is deleted, you will not be able to edit it. To delete the lock, open SQL Studio, select your CM DB, and run the follow query:

SELECT * FROM SEDO_LockState WHERE LockStateID <> 0
—- Take note of the ID you want to delete

DELETE FROM SEDO_LockState WHERE LockID = ‘850D4B06-E067-4E27-8172-5A224C511A07’
—–LockID is the ID you want to remove the lock on

 

PowerShell

Unlock-CMObject -InputObject $(Get-CMApplication -Name Winzip)

Return InputObjects

Get-CMApplication
Get-CMPackage
Get-CMDriverPackage
Get-CMOperatingSystemImage
Get-CMBootImage
Get-CMTaskSequence

Notes

get-help Unlock-CMObject -Full

NAME

Unlock-CMObject

SYNTAX

Unlock-CMObject \[-InputObject] <IResultObject[]> [-WhatIf\] \[-Confirm\] [<CommonParameters>]

PARAMETERS

-Confirm

Required? false

Position? Named

Accept pipeline input? false

Parameter set name (All)

Aliases cf

Dynamic? false

-InputObject <IResultObject[]>

Required? true

Position? 0

Accept pipeline input? true (ByPropertyName)

Parameter set name ByValue

Aliases None

Dynamic? false

-WhatIf

Required? false

Position? Named

Accept pipeline input? false

Parameter set name (All)

Aliases wi

Dynamic? false

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters ([http://go.microsoft.com/fwlink/?LinkID=113216)](http://go.microsoft.com/fwlink/?LinkID=113216)).

INPUTS

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject[]

OUTPUTS

System.Object

ALIASES

None