Lock-CMObject

Locks global objects in Configuration Manager.

Syntax

Lock-CMObject
    [-InputObject] <IResultObject[]>
    [-Confirm]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [<CommonParameters>]

Description

The Lock-CMObject cmdlet acquires locks of one or more objects in Microsoft System Center Configuration Manager. You can use the InputObject parameter to specify the input to this cmdlet, or you can pipe the input to this cmdlet. When you obtain the lock, the lock is assigned to you, your computer and the site in which the computer resides. While the lock is assigned to you, no other user or computer can edit the object until you release the lock.

Important: Configuration Manager cmdlets now automatically handle the locking and unlocking of objects. Therefore, we do not recommend you use this cmdlet to lock objects because this may interfere with the functionality of the cmdlets.

Examples

Example 1: Lock a global object

PS C:\> $CIObj = Get-CMDriverPackage -Id "CM100042"
PS C:\> Lock-CMObject -InputObject $CIObj

The first command gets the driver package object that has the ID CM100042, and stores the object in the $CIObj variable.

The second command locks the object stored in $CIObj.

Required Parameters

-InputObject

Specifies an array of Configuration Manager objects output from another cmdlet.

Type:IResultObject[]
Required:True
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

Indicates that wildcard handling is enabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False