Lock-ControlledGpo

Mis à jour: août 2015

S'applique à: Advanced Group Policy Management 4.0 SP3

Lock-ControlledGpo

Locks controlled GPOs.

Syntaxe

Parameter Set: Default
Lock-ControlledGpo [[-ControlledGpos] <ControlledGpo[]> ] [-Comment <String> ] [-DiscardChanges] [-Domain <String> ] [-PassThru] [ <CommonParameters>]




Description détaillée

The Lock-ControlledGpo cmdlet locks controlled Group Policy Objects (GPOs). A locked GPO cannot be edited. Locking is the equivalent of checking in a GPO to the Advanced Group Policy Management (AGPM) archive. If you specify the DiscardChanges parameter, the cmdlet reverts any changes made to the GPO. This operation is the same as undoing the checkout of a GPO.

Paramètres

-Comment<String>

Specifies a comment for the change that this cmdlet makes.


Alias

none

Obligatoire ?

false

Position ?

named

Valeur par défaut

none

Accepter l’entrée de pipeline ?

false

Accepter les caractères génériques ?

false

-ControlledGpos<ControlledGpo[]>

Specifies an array of GPOs to lock. To obtain controlled GPOs, use the Get-ControlledGpo cmdlet.


Alias

none

Obligatoire ?

false

Position ?

1

Valeur par défaut

none

Accepter l’entrée de pipeline ?

true(ByValue,ByPropertyName)

Accepter les caractères génériques ?

false

-DiscardChanges

Indicates that this cmdlet discards any changes that have been made to the controlled GPO. Discarding changes is the same as undoing a check out.


Alias

none

Obligatoire ?

false

Position ?

named

Valeur par défaut

none

Accepter l’entrée de pipeline ?

false

Accepter les caractères génériques ?

false

-Domain<String>

Specifies the fully qualified domain name (FQDN) of a domain. This cmdlet operates on GPOs in the domain that this parameter specifies. If the AGPM service runs as part of a different domain, and if this cmdlet specifies that domain, a trust relationship must exist between that domain and the domain of the current user or computer.

If you do not specify a domain, this cmdlet uses the domain of the current user.

If you use this cmdlet as part of a computer startup or shutdown script, and if the command does not specify this parameter, the cmdlet uses the domain of the computer.


Alias

none

Obligatoire ?

false

Position ?

named

Valeur par défaut

none

Accepter l’entrée de pipeline ?

false

Accepter les caractères génériques ?

false

-PassThru

Indicates that this cmdlet returns the controlled GPOs on which the cmdlet operates. If you do not specify this parameter, this cmdlet returns no results.


Alias

none

Obligatoire ?

false

Position ?

named

Valeur par défaut

none

Accepter l’entrée de pipeline ?

false

Accepter les caractères génériques ?

false

<CommonParameters>

Cette applet de commande prend en charge les paramètres courants : -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer et -OutVariable. Pour plus d’informations, consultez about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).

Entrées

Le type d’entrée correspond au type des objets que vous pouvez transmettre à l’applet de commande.

  • Microsoft.Agpm.ControlledGpo

    This cmdlet accepts controlled GPOs that are currently unlocked.


Sorties

Le type de sortie est le type des objets émis par l’applet de commande.

  • Microsoft.Agpm.ControlledGpo

    This cmdlet returns controlled GPO objects, if you specify the PassThru parameter.


Exemples

Example 1: Lock all checked out GPOs

This command uses the Get-ControlledGpo cmdlet to get all controlled GPOs in the current domain. The command passes those GPOs to the Where-Object cmdlet. That cmdlet passes any GPOs that have a state of CHECKED_OUT to the current cmdlet. This cmdlet locks all of those GPOs.


PS C:\> Get-ControlledGpo | Where {$_.VaultState -eq "CHECKED_OUT"} | Lock-ControlledGpo 

Example 2: Revert and lock all checked out GPOs

This command discards changes and locks all GPOs that are currently checked out. This example is the same as the previous example, except that it specifies the DiscardChanges parameter. It also specifies the PassThru parameter to display the results.


PS C:\> Get-ControlledGpo | Where {$_.VaultState -eq "CHECKED_OUT"} | Lock-ControlledGpo -DiscardChanges -PassThru

Rubriques connexes

Ajouts de la communauté

AJOUTER
Afficher: