Lock-CMObject
Create a SEDO lock on an object.
Syntax
Lock-CMObject
[-InputObject] <IResultObject[]>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Warning
Configuration Manager cmdlets automatically lock and unlock objects. Use of this cmdlet may interfere with the functionality of other cmdlets.
The Lock-CMObject cmdlet acquires a SEDO lock on one or more objects. Configuration Manager SEDO (Serialized Editing of Distributed Objects) is a mechanism to assign locks to globally replicated objects. If a user wants to edit and save an object, they have to get a lock from the site. The site assigns a lock to the user for that object, on their computer, and in the site. While the user has the lock, no one else can edit the object.
For more information, see Configuration Manager SEDO.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>
. For more information, see getting started.
Examples
Example 1: Lock a driver package
The first command gets the driver package with the ID CM100042, and stores it in the $CIObj variable. The second command locks the object. The third command shows the details of the lock.
$CIObj = Get-CMDriverPackage -Id "CM100042"
Lock-CMObject -InputObject $CIObj
Get-CMObjectLockDetails -InputObject $CIObj
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
Specify an array of Configuration Manager objects that are output from another cmdlet. For example, to get an application object, use the Get-CMApplication cmdlet.
For a list of objects that are SEDO-enabled, see Configuration Manager SEDO.
Type: | IResultObject[] |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet doesn't run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.ConfigurationManagement.ManagementProvider.IResultObject[]
Outputs
System.Object