web analytics


How to Acquire a Lock on a SEDO-Enabled Object

Posted by:

To Acquire an Explicit Lock on a SEDO-enabled Object

  1. Create an instance of the SMS_ObjectLock WMI class.
  2. Get the method parameters object for the RequestLock method.
  3. Assign the object path of the object you wish to lock to the ObjectRelPath property.
  4. Set the RequestTransfer property to True.
  5. Create an InvokeMethodOptions object instance. On the Context property, add a name/value pair. The name must be “ObjectLockContext” and the value must be a unique value such as a Guid. Add another name/value pair with “MachineName” and the name of the machine requesting the lock.
  6. Call InvokeMethod on the SMS_ObjectLock instance.
  7. InvokeMethod will return a SMS_ObjectLockRequest instance. Check the RequestState and LockState properties to get more information on the success or failure of the request.


Example Output

You can download the code examples from here

About the Author:

Kaido Järvemets is a developer, consultant, trainer specializing in Microsoft System Center Configuration Manager and PowerShell Solutions at Coretech. Kaido frequently speaks at European conferences and had his US debut as speaker at MMS April 2013. Kaido is well-known in the Configuration Manager communities where he’s a key player in the PowerShell game. Kaido host one of the most complete Configuration Manager PowerShell library’s in the world with hundreds of free code samples ready to download and implement – www.cm12sdk.net. Kaido has been awarded Microsoft Most Valuable Professional (MVP) in Microsoft Enterprise Client Management for his work with Configuration Manager from 2011 – to present. Kaido is the founder of System Center User Group Estonia in 2011.

Add a Comment