$myGC = Get-CMGlobalCondition -Name "Operating System" |Where-Object PlatformType -eq 1
$myGC2 = Get-CMGlobalCondition -Name"UserLoggedOn"
$platformA = Get-CMConfigurationPlatform-Id "16777298"
$myRule = $myGC | New-CMRequirementRuleOperatingSystemValue -RuleOperator OneOf-Platform $platformA
$myRule2 = New-CMRequirementRuleBooleanValue -GlobalCondition $myGC2-Value $false
$myRule3 = New-CMRequirementRuleBooleanValue -GlobalCondition $myGC2-Value $true
Set-CMScriptDeploymentType-ApplicationName $SharpApplicationXML.Title-DeploymentTypeName($SharpApplicationXML.DeploymentTypes.title | Where-Object {$_ -like "*- LoggedOn" }) -AddRequirement $myRule3
Set-CMScriptDeploymentType-ApplicationName $SharpApplicationXML.Title-DeploymentTypeName($SharpApplicationXML.DeploymentTypes.title | Where-Object {$_ -like "*- LoggedOn" }) -AddRequirement $myRule
Set-CMScriptDeploymentType-ApplicationName $SharpApplicationXML.Title-DeploymentTypeName($SharpApplicationXML.DeploymentTypes.title | Where-Object {$_ -like "*- NotLoggedOn" }) -AddRequirement $myRule2
Set-CMScriptDeploymentType-ApplicationName $SharpApplicationXML.Title-DeploymentTypeName($SharpApplicationXML.DeploymentTypes.title | Where-Object {$_ -like "*- NotLoggedOn" }) -AddRequirement $myRule
Inga kommentarer:
Skicka en kommentar