Register-DMGPOwner
SYNOPSIS
Define the desired state for group policy ownership.
SYNTAX
Explicit
Register-DMGPOwner -GpoName <string> -Identity <string> [-ContextName <string>] [<CommonParameters>]
Filter
Register-DMGPOwner -Filter <string> -Identity <string> [-Weight <int>] [-ContextName <string>]
[<CommonParameters>]
All
Register-DMGPOwner -All -Identity <string> [-ContextName <string>] [<CommonParameters>]
DESCRIPTION
Define the desired state for group policy ownership. Afterwards use Test-DMGPOwner to determine, whether reality matches desire. Or Invoke-DMGPOwner to bring reality into the desired state.
You can define ownership in three ways:
- Explicitly to a specific group policy object
- By filter, using the same filter syntax as used for GP Permissions
- Global, a default setting for when the other two do not apply
In Case multiple rules apply to a GPO, this precedence will be adhered to: Explicit > Filter > Global In case multiple filters apply, the one with the lowest Weight value applies.
EXAMPLES
EXAMPLE 1
Get-Content .\gpoowners.json | ConvertFrom-Json | Write-Output | Register-DMGPOwner
Reads all settings from the provided json file and registers them.
PARAMETERS
-All
Define a global default rule. There can always only be one global default value.
Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: All
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-ContextName
The name of the context defining the setting. This allows determining the configuration set that provided this setting. Used by the ADMF, available to any other configuration management solution.
Type: System.String
DefaultValue: <Undefined>
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Filter
The filter by which to determine which GPO this rule applies to. Examples:
- "IsManaged -and Tier0"
- "-not (IsManaged) -or (Tier1 -and UserScope)" Each condition (e.g. "IsManaged" or "Tier0") needs to be defined as a condition separately.
Conditions are documented here:
- https://admf.one/documentation/components/domain/gppermissionfilters.html Examples on how to use them can be found in the "Filter" parameter description here:
- https://admf.one/documentation/components/domain/gppermissions.html
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Filter
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-GpoName
The name of the GPO this rule applies to. This parameter uses name resolution.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Explicit
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Identity
The identity that should be the owner of the affected GPO(s). Can be a sid or an NT identity reference. This parameter supports name resolution.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: All
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
- Name: Filter
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
- Name: Explicit
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Weight
The precedence order when multiple filter conditions apply. The lower the number, the higher the priority.
Type: System.Int32
DefaultValue: 50
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Filter
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.