|
Post by chrisc on Nov 9, 2023 14:47:03 GMT
I am trying to assign a device to an OU based on a WMIRead value. So if the csmodel = 21C2S39300 it goes into OU A any other result goes into OU B.
What is the easiest way to do this?
|
|
|
Post by geeksbsmrt on Nov 9, 2023 21:23:01 GMT
Switch would be quick and easy. Example for using switch based on a built-in Hardware Model variable, but if you have this stored in a different variable it should work just the same.
<Action Type="DefaultValues" ValueTypes="Asset"/>
<Action Type="Switch" OnValue="%XHWModel%">
<Case RegEx="21C2S39300" CaseInsensitive="True">
<Variable Name="OSDJoinDomainOUName">"LDAP://OU=A,DC=domain,DC=com"</Variable>
</Case>
<Default>
<Variable Name="OSDJoinDomainOUName">"LDAP://OU=B,DC=domain,DC=com"</Variable>
</Default>
</Action>
|
|
|
Post by chrisc on Nov 10, 2023 13:10:58 GMT
Awesome, thanks! I actually got it working using WMIRead. Plenty of different methods to do this.
<ActionGroup Name="Laptop Group" Condition='"%XHWChassisType%" = "Laptop"'> <Action Type="TSVar" Name="OSDDomainOUName">"LDAP://OU=Win 10 Laptops,OU=A,DC=domain,DC=com" </Action> <Action Type="WMIRead" Namespace="root\cimv2" Class="Win32_ComputerSystem" Property="model" Variable="csmodel" /> <Action Type="TSVar" Name="OSDDomainOUName">"LDAP://OU=Win 11 Laptops,OU=B,DC=domain,DC=com" Condition='"%csmodel%" = "21C2S39300"' </Action> </ActionGroup>
|
|