A new Flexera Community experience is coming on November 18th, click here for more information.
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!
Jan 26, 2024 01:16 PM
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.
Jan 26, 2024 02:20 PM
Never really looked at it before, but I do see two variables named ##ConfigMgrID## when I hit the getResolvedRequestVariables() method in integration.asmx (http://localhost/esd/ws/integration.asmx/GetResolvedRequestVariables)
One of the values is correct, and one is not.
I'll see where the incorrect value is coming from if I can. I know that we should be able to create a new variable entirely (we could call it resourceID), if you wanted to use a custom sync computer query.
Jan 26, 2024 01:35 PM
Thanks for the quick note on that Charles! We are already using a custom computer sync query so that may work. Would the new property be able to be passed along as an argument?
Jan 26, 2024 01:45 PM
Correct, any new property that you add to the sync query (either user or computer) should be available as a new variable that you can resolve. The variable name will be the same as the property that you add to your query.
Jan 26, 2024 01:49 PM
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.
Jan 26, 2024 02:20 PM
Thank you! Yes ,that makes sense since I was getting the same ID when I tested from different machines. I am going to try bringing in the additional ResourceID as a different variable name.
Jan 26, 2024 07:29 PM