Edit

Share via


New-CMRequirementRuleOUValue

Create an Active Directory organizational unit (OU) requirement rule for an application deployment type.

Syntax

Default (Default)

New-CMRequirementRuleOUValue
    -OrganizationalUnit <Hashtable[]>
    -RuleOperator <RuleExpressionOperator>
    [-InputObject] <IResultObject>
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [<CommonParameters>]

Description

Use this cmdlet to create an Active Directory organizational unit (OU) requirement rule for an application deployment type.

After you use this cmdlet, then use one of the Add- or Set- cmdlets for deployment types. Pass this requirement rule object to either the AddRequirement or RemoveRequirement parameters.

For more information, see Deployment type Requirements and Create global conditions.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Add a requirement rule for Active Directory OUs

This example first uses the Get-CMGlobalCondition cmdlet to get the default Organizational unit (OU) global condition. It then defines several variables for two Active Directory OUs. Next it creates the requirement rule object. Finally it passes that rule object to the Set-CMScriptDeploymentType cmdlet to add the requirement.

$myGC = Get-CMGlobalCondition -Name "Organizational unit (OU)"

$ouName1 = "CN=Computers,DC=Contoso,DC=Com"

$ouName2 = "CN=Servers,DC=Contoso,DC=Com"

$ouA = @{"OU"=$ouName1; "IsIncludeSubOU"=$true}

$ouB = @{"OU"=$ouName2; "IsIncludeSubOU"=$false}

$myRule = $myGC | New-CMRequirementRuleOUValue -RuleOperator NoneOf -OU $ouA,$ouB

Set-CMScriptDeploymentType -ApplicationName "Central App" -DeploymentTypeName "Install" -AddRequirement $myRule

Parameters

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Specify a global condition object to use as the basis for this requirement rule. To get this object, use the Get-CMGlobalCondition cmdlet.

In most instances, you'll use the default Organizational unit (OU) global condition, for example: Get-CMGlobalCondition -Name "Organizational unit (OU)".

Parameter properties

Type:IResultObject
Default value:None
Supports wildcards:False
DontShow:False
Aliases:GlobalCondition

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-OrganizationalUnit

Specify a hashtable to specify the name of the OU and whether to include child OUs. For example:

@{"OU"="CN=Computers,DC=Contoso,DC=Com"; "IsIncludeSubOU"=$true}

Parameter properties

Type:

Hashtable[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:OrganizationalUnits, OU, OUs, OrganizationalUnitWithSubOUOption, OrganizationalUnitWithSubOUOptions

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RuleOperator

Specify the operator to compare the device's setting with the expected value.

Parameter properties

Type:RuleExpressionOperator
Default value:None
Accepted values:OneOf, NoneOf
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

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.

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object