SCCM – Cannot edit the object, which is in use by ‘domain\SCCM-ADMIN’ at site P01

During the configuration of an OSD our SCCM 2016 console crashed and afterwards we suddenly found ourselves without any ability to make changes.

The error was “Cannot edit the object, which is in use by ‘domain\SCCM-ADMIN’ at site P01”.Locked screen
Because of the console crash SCCM still thinks that the object is being edited.
This is because ConfigMgr 2012/2016 handles editing of objects through something called “SEDO” or “Serialized Editing of Data Objects.”.
Locked objects can be found in the SEDO_LockState table in the ConfigMgr database.

You can locate the record in question by searching for LockStateID that’s not zero, or by the user ID that ConfigMgr says is editing the object (‘AssignedUser’).
On the database server run the following query against the CCM_01 database:
select * from SEDO_LockState where LockStateID <> 0

Locked in SCCM

Use the LockedID with the appropriate information to remove the record related to the object*.
DELETE from SEDO_LockState where LockID = ‘<LockID of the record identified in the previous query>’
ScreenHunter_66 Jul. 01 10.42
Once the record is removed, you should be able to modify the object.