1
Vote

Issue with New-SCCMGlobalConditionsRule

description

I am having issues trying to add a requirement to an existing application and deployment type. I am able to successfully leverage the powershell cmdlets with no errors, but the requirement is never written. The issue seems to be related to the cmdlet New-SCCMGlobalConditionsRule.

If I use the Copy-SCCMRequirementRule cmdlet and use as the rule to add, it works successfully.

When using the New-SCCMGlobalConditionsRule, I get the following output (server and site removed):

command: New-SCCMGlobalConditionsRule -GlobalConditionName "Total Physical Memory" -Operator "GreaterThan" -Value 524520021

output:
RuleId : Rule_e4d62cbd-e6b0-4062-8358-7b8e15a67480
MarkRuleNonCompliantWhenSettingIsMissing : False
Expression: Microsoft.SystemsManagementServer.DesiredConfigurationManagement.Expressions.Expression
KeyPropertyRuleIds : {}
Severity : None
IsHidden : False
Annotation : Microsoft.SystemsManagementServer.DesiredConfigurationManagement.Rules.Annotation
RuleContext : Microsoft.SystemsManagementServer.DesiredConfigurationManagement.Rules.RuleScope
Name : \<server>\root\sms\Site
<code>:SMS_GlobalCondition.CI_ID=2.LocalizedDisplayName GreaterThan 524520021
Description :
IsDirty : False
_

Not sure where the issue is. These are the sequence of commands I am running:

$myapp = Get-SCCMApplication -ApplicationName "Anthony Test 3.0 VREV1"
$myxml = Get-SCCMApplicationObject -ApplicationName $myapp.LocalizedDisplayName
$newrule = New-SCCMGlobalConditionsRule -GlobalConditionName "Total Physical Memory" -Operator "GreaterThan" -Value 524520021
$myxml.DeploymentTypes[0].Requirements.Add($newrule)
$newxml = Save-SCCMApplicationObject -AppObject $myxml
Save-SCCMApplication -ApplicationName "Anthony Test 3.0 VREV1" -xml $newxml

comments

tommm73 wrote Apr 17, 2015 at 4:23 PM

I would like to link my deploymenttype to a custom Global Condition alreayd created...I dont see the option in the SettingSourceType to use it