|
Post by el3kt2ik on Jan 3, 2019 15:42:07 GMT
I am utilizing the WMIRead feature to pull information from Win32_SystemEnclosure for the SMBIOSAssetTag however the variable is being filled with the serial number.
<Action Type="WMIRead" Variable="ComputerName" Namespace="root\cimv2" Class="Win32_ComputerSystem" Property="Name"/>
<Action Type="WMIRead" Variable="MachineAssetTag" Namespace="root\cimv2" Class="Win32_SystemEnclosure" Property="SMBIOSAssetTag" Default=""/>
<Action Type="Input" Name="AssetTag" Title="No asset tag found" Condition='"%MachineAssetTag%" = "" Or Len("%MachineAssetTag%")< 6 Or Len("%MachineAssetTag%") > 6'>
<TextInput Prompt="Asset Tag" Hint="No asset tag was found for this system, please the 6 digit value." Question="Please enter an asset tag." RegEx=".{6}" Variable="MachineAssetTag" />
</Action>
<Action Type="Info" Title="System Name" Name="SystemName"> <![CDATA[The name of this system will be <b>%MachineAssetTag%%W%-PC</b>.]]> </Action>
<Action Type="TSVar" Name="OSDComputerName" DontEval="True">%MachineAssetTag%%W%%PrefixMachineName%</Action>
|
|
|
Post by el3kt2ik on Jan 3, 2019 16:03:21 GMT
I have since wrote a query instead and replaced the read referenced above,
<Action Type="WMIRead" Namespace="root\cimv2" Query='select SMBIOSAssetTag from Win32_SystemEnclosure where SMBIOSAssetTag LIKE ""' Property="SMBIOSAssetTag" Variable="MachineAssetTag" />
and this is no longer populating the serial number, however I very much rather prefer a direct read of the information instead of querying it.
|
|
|
Post by el3kt2ik on Jan 3, 2019 19:26:00 GMT
Disregard, for some reason the SMBIOS asset tag field and serial number field are the same on most of the machines in my environment.
|
|