Jump to content


66945

Unlock-Object

Recommended Posts

Hi,

My console crashed and I'm trying to unlock the locked object (a task sequence).
I tried using the Unlock-Object cmdlet in PowerShell but it fails with this error:

Unlock-CMObject -InputObject $(Get-CMTaskSequence -Name Test)
Unlock-CMObject : Cannot unlock object. Object context '874f0b81-e922-4ebe-94a5-3c3bfaeba50d' is different than the current session context '7eead30c-5325-4087-9c20-8f0396c0c3ec'.
At line:1 char:1
+ Unlock-CMObject -InputObject $(Get-CMTaskSequence -Name Test)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Confi...ckObjectCommand:UnlockObjectCommand) [Unlock-CMObject], SmsException
    + FullyQualifiedErrorId : ObjectLocked,Microsoft.ConfigurationManagement.Cmdlets.Common.Utility.UnlockObjectCommand

How can I target the 'correct session context'?

I only have 1 Primary Site and the PowerShell session is connected to that Primary Site.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.