New-CMRequirementRuleDeviceOwnershipValue

Create a device ownership requirement rule for an application deployment type.

Syntax

New-CMRequirementRuleDeviceOwnershipValue
   -OwnershipOption <OwnershipType>
   -RuleOperator <RuleExpressionOperator>
   [-InputObject] <IResultObject>
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [<CommonParameters>]

Description

Use this cmdlet to create a device ownership requirement rule for an application deployment type. The Ownership default global condition determines whether the device is Personal or Company owned.

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 device ownership

This example first uses the Get-CMGlobalCondition cmdlet to get the default Ownership global condition. Next it creates the requirement rule object. Finally it passes that rule object to the Set-CMScriptDeploymentType cmdlet to add the requirement.

$gc = Get-CMGlobalCondition -Name "Configuration Manager site"
$sites = @('XYZ', 'ABC')
$rule = New-CMRequirementRuleActiveDirectorySiteValue -InputObject $gc -RuleOperator IsEquals -OwnershipOption Company

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

Parameters

-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 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 Ownership global condition, for example: Get-CMGlobalCondition -Name "Ownership".

Type:IResultObject
Aliases:GlobalCondition
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-OwnershipOption

Specify the device ownership type to compare against the device's configuration.

Type:OwnershipType
Accepted values:Personal, Company
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RuleOperator

Specify the operator to compare the device's setting with the OwnershipOption.

Type:RuleExpressionOperator
Accepted values:IsEquals, NotEquals
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object