Post by fp00099 on May 6, 2019 15:48:25 GMT
What I am finding is that if 2 of 3 conditions match the ChoiceOption is displayed. I want it to evaluate all three before displaying, what am I missing here?
Condition 1: "InStr ("%XAuthenticatedUserGroups%" & ",", "R_SCCM_Workstation_Admin_Tier2,") > 0 Or InStr ("%XAuthenticatedUserGroups%" & ",", "R_SCCM_Admin,") > 0
AND
Condition 2: "%XHWManufacturer%" = "HP" Or "%XHWManufacturer%" = "VMware, Inc."
AND
Condition 3: "%ZZIsWorkstationTS%" = "True"
The code looks correct but a second set of eyes is helpful.
The evaluation of the condition matches the AD group and Manufacturer however the variable doesn't exist; yet the Choice still appears.
Works (Choice appears)
InStr ("R_SCOR_Admin,R_SCCM_Admin" & ",", "R_SCCM_Workstation_Admin_Tier2,") > 0 Or InStr ("R_SCOR_Admin,R_SCCM_Admin" & ",", "R_SCCM_Admin,") > 0 And "HP" = "HP" Or "HP" = "VMware, Inc." And "" = "True"
Fails (Choice does not appear)
InStr ("R_SCOR_Admin,R_SCCM_Admin" & ",", "R_SCCM_Workstation_Admin_Tier2,") > 0 Or InStr ("R_SCOR_Admin,R_SCCM_Admin" & ",", "R_SCCM_Admin,") > 0 And "Hewlett-Packard" = "HP" Or "HP" = "VMware, Inc." And "" = "True"
Condition 1: "InStr ("%XAuthenticatedUserGroups%" & ",", "R_SCCM_Workstation_Admin_Tier2,") > 0 Or InStr ("%XAuthenticatedUserGroups%" & ",", "R_SCCM_Admin,") > 0
AND
Condition 2: "%XHWManufacturer%" = "HP" Or "%XHWManufacturer%" = "VMware, Inc."
AND
Condition 3: "%ZZIsWorkstationTS%" = "True"
The code looks correct but a second set of eyes is helpful.
…
<Action Type="TSVar" Name="_SMSTSPackageName">"_PP Deploy Windows Server x64 (v4.0)"</Action>
<Action Type="TSVar" Name="ZZIsWorkstationTS" Condition='InStr("%_SMSTSPackageName%","Workstation") > 0'>"True"</Action>
<Action Type="TSVar" Name="ZZIsServerTS" Condition='InStr("%_SMSTSPackageName%","Server") > 0'>"True"</Action>
<Action Type="Input" Name="ClientSetupInput" Title="Client OS" ShowBack="True" ShowCancel="True" Size="Tall" >
<TextInput Prompt="Computer Name" Hint="Enter the name for this system" RegEx=".{3,15}" Variable="ZZComputerName" Question="Name for this system" Default="%OSDComputerName%" />
<CheckBoxInput Variable="DomainJoin" Question="Should this system be domain joined? (Checked = Yes)" CheckedValue="Yes" UncheckedValue="No" Default="Yes" />
<ChoiceInput Variable="ZZOSDImageName" Question="Select the operating system." Required="True" >
<Choice Option="Windows 10 Enterprise, version 1803 (x64)" Value="Win10v1803x64" Condition='InStr ("%XAuthenticatedUserGroups%" & ",", "R_SCCM_Workstation_Admin_Tier2,") > 0 And "%XHWManufacturer%" = "HP" Or "%XHWManufacturer%" = "VMware, Inc." And "%ZZIsWorkstationTS%" <> ""' />
<Choice Option="Windows 10 Enterprise, version 1709 (x64)" Value="Win10v1709x64" Condition='InStr ("%XAuthenticatedUserGroups%" & ",", "R_SCCM_Workstation_Admin_Tier2,") > 0 Or InStr ("%XAuthenticatedUserGroups%" & ",", "R_SCCM_Admin,") > 0 And "%XHWManufacturer%" = "HP" Or "%XHWManufacturer%" = "VMware, Inc." And "%ZZIsWorkstationTS%" = "True"' />
<Choice Option="Windows 7 Enterprise, Service Pack 1 (x64)" Value="Win7SP1x64" Condition='InStr ("%XAuthenticatedUserGroups%" & ",", "R_SCCM_Workstation_Admin_Tier2,") > 0 Or InStr ("%XAuthenticatedUserGroups%" & ",", "R_SCCM_Admin,") > 0 And "%XHWManufacturer%" = "Hewlett-Packard" Or "%XHWManufacturer%" = "VMware, Inc." And "%ZZIsWorkstationTS%" = "True"' />
</ChoiceInput>
</Action>
…
The evaluation of the condition matches the AD group and Manufacturer however the variable doesn't exist; yet the Choice still appears.
Works (Choice appears)
InStr ("R_SCOR_Admin,R_SCCM_Admin" & ",", "R_SCCM_Workstation_Admin_Tier2,") > 0 Or InStr ("R_SCOR_Admin,R_SCCM_Admin" & ",", "R_SCCM_Admin,") > 0 And "HP" = "HP" Or "HP" = "VMware, Inc." And "" = "True"
Fails (Choice does not appear)
InStr ("R_SCOR_Admin,R_SCCM_Admin" & ",", "R_SCCM_Workstation_Admin_Tier2,") > 0 Or InStr ("R_SCOR_Admin,R_SCCM_Admin" & ",", "R_SCCM_Admin,") > 0 And "Hewlett-Packard" = "HP" Or "HP" = "VMware, Inc." And "" = "True"