
Angersma asked a question.
Hello - has anyone ever tried to set an argument in a Script Command, that includes the device's ConfigMgrID property?
I see the correct ID for the device in ConfigMgrID field for the record in the WD_Computer table. But selecting the ConfigMgrID property in my Script Command passes some other value into the script as an argument.
If you have a solution, please share! Thanks!
Yes, if you use a custom sync query and pull the resourceID as a custom value in that query, it will be available as a variable for command parameters and email variables. It will show up in GetResolvedRequestVariables like everything else.
I believe what you're seeing is that WD_User and WD_Computer both use the same column names for all of those IDs (ConfigMgrID, CM7ID, CM12ID, etc.), so when we do variable resolution, you'll see both the user and the computer ConfigMgrID listed with the same variable name. Unfortunately, there is no way for you to choose which one will be referenced when you use the variable. So, your options are to do a custom sync and pull that value in with a different variable name or to just pass the RequestID or ComputerID as your parameter, and then have your command script look up the values you want from the database.