The RequestLock Windows Management Instrumentation (WMI) class, in Configuration Manager, synchronously acquires a lock to edit a global object.

The following syntax is simplified from Managed Object Format (MOF) code and defines the method.

SInt32 RequestLock(
	string ObjectRelPath, 
	boolean RequestTransfer, 
	string RequestID, 
	uint32 RequestState, 
	uint32 LockState, 
	string AssignedUser, 
	string AssignedObjectLockContext, 
	string AssignedMachine, 
	string AssignedSiteCode, 
	datetime AssignedTimeUTC
);

Parameters

ObjectRelPath

Data type: StringQualifiers: [in]The path of the object for which the lock is requested.
RequestTransfer

Data type: BooleanQualifiers: [in, optional]If the lock is not owned by the local site, the lock request should be forwarded to the parent/child site.
RequestID

Data type: String Qualifiers: [out]Unique identifier of the request.
RequestState

Data type: UInt32 Qualifiers: [out]Request state values. The request states Granted, GrantedAfterTimeout and GrantedLockWasOrphaned indicate a successful request and the user can then make and save modifications to the object. All other requests indicate an error.

RequestStateID RequestStateName

0

Unknown

2

Requested

3

RequestedCanceled

4

ResponseReceived

10

Granted

11

GrantedAfterTimeout

12

GrantedLockWasOrphaned

20

DeniedLockAlreadyAssigned

21

DeniedInvalidObjectVersion

22

DeniedLockNotFound

23

DeniedLockNotLocal

24

DeniedRequestTimedOut

50

Error

52

ErrorRequestNotFound

53

ErrorRequestTimedOut

LockState

Data type: UInt32 Qualifiers: [out]Indicates the current state of the requested lock. Possible values are:

0

Unassigned

1

Assigned

2

Requested

3

PendingAssignment

4

TimedOut

5

NotFound

AssignedUser

Data type: String Qualifiers: [out]Indicates the currently assigned user of the requested lock.
AssignedObjectLockContext

Data type: String Qualifiers: [out]Indicates ObjectLockContext the lock is currently assigned to.
AssignedMachine

Data type: String Qualifiers: [out]Indicates the currently assigned computer of the requested lock.
AssignedSiteCode

Data type: String Qualifiers: [out]Indicates the current site of the requested lock.
AssignedTimeUTC

Data type: DateTime Qualifiers: [out]Indicates the current site of the requested lock.

Return Values

An SInt32 data type that is 0 to indicate success or non-zero to indicate failure.

For information about handling returned errors, see About Configuration Manager Errors.

Requirements

Runtime Requirements

Development Requirements

See Also