Automatically Map Custom Field based on other Inventory attribute
Hello-
Is there a way to automatically map a custom field based on another attribute within Inventory. My use case is tracking whether a machine is a physical box versus a VM. ie, if manufacturer does not equal VMWare, set CustomField Type=Physical; if manufacturer equal VMWare, set CustomField Type=Virtual.
Currently I am exporting VMs from vCenter, and using the import wizard to set the CustomField for VM, and then taking the difference between the export and what PDQ has and setting the rest to physical. It gets a bit more complicated due to tracking which physical datacenter the VMs are located in, which we have based on a naming convention (if name = xx set customfield DataCenter = DC1, if name = yy set customfield DataCenter=DC2)
If this is not possible, please consider this a feature request.
Comments
Hi Patrick,
PDQ Inventory does give you the ability to add custom fields, but these are manually entered, and are meant for things that cannot be derived from the machine electronically - and since you definitely can get the manufacturer value, I wouldn't recommend the laborious way of entering this manually for each machine.
If you need to quickly find all VMs known to PDQ Inventory that have VMWare as manufacturer, you can simply make a dynamic collection that filters on that specific criterion. The collection will automatically update itself based on changes in your AD, when machines are added/removed.
There's a nice video tutorial here on filters; each video description links to the next part in the series. It's a quick watch.
https://www.youtube.com/watch?v=IJ3wSpBHLiA&feature=youtu.be
Of course, there's also the built-in documentation that you can read through. If you like, I can maybe help you a bit with creating one.
Once you have a collection, you can then take actions on it (such as deployments, or using it as a criterion in a second filter).
You also have the option of adding the machines to an Active Directory group, and checking for group membership in a filter.
I hope this was helpful, if not, please clarify?
Hi ah,
Sorry, I was not clear on what I meant. I mean to use an existing scannable attribute, like Manufacturer, and use that to add a custom field. For example, our VMWare Manufactured servers would all be added to the CustomField Type, and if name contains co1, add to CustomField DataCenter = Colo, if name contains ne7 add to CustomField DataCenter = New England, etc.
What I mean is the automatic mapping of CustomFields based on other scannable items like manufacturer and name.
Hello again Patrick,
I did catch that much, but I don't understand why you need to do it this way?
Why check a custom field, when you can simply check manufacturer?
Is this because you want to list them all in a report with these "enriched" fields, so it is more "human readable"?
Someone else probably knows more than I do, but I believe the only way you can populate custom fields apart from manual entry is the import wizard, which you already seem familiar with. If what you want to do is "calculate" custom fields based on other metadata in PDQ Inventory, for the primary purpose of presenting these fields in reports/views, I can't see a way to do that. But perhaps others can?
I would also note that this is a community forum, and as such I wouldn't expect the developers to notice feature requests in here. I'd try submitting it here instead: https://help.pdq.com/hc/en-us/requests/new
"If what you want to do is "calculate" custom fields based on other metadata in PDQ Inventory, for the primary purpose of presenting these fields in reports/views, I can't see a way to do that. "
That is exactly what I am trying to do. It is to import into our CMDB with a location field in terms of which datacenter a machine is in. I have not been able to find a way to do it thus far, so it probably does not exist.
Okay, in that event, I'd say do these "calculations" in a script instead. You could either define a SQL report directly in PDQ Inventory, where you can probably create all the custom fields you want for your report, or you could run a PowerShell script outside of PDQ Inventory against your AD, and calculate the custom fields there - output it all into a CSV that you then import into PDQ Inventory using the wizard.
But I freely admit that while I've been using PDQ Deploy for about 2 years,I haven't been using PDQ Inventory for more than 4 months or so.
I'd say open a ticket via the link I gave you to make sure, unless the SQL/PowerShell solutions satisfy your needs. :-)
Sorry I couldn't be of more help.
Thanks. The Powershell/SQL method will probably work for my needs. Thank you!
Hi Patrick,
great, I hope it works out! And I forgot to say, I'd love to see your solution if you get it working, so please post it here if and when you can.
Likely others can benefit too, myself included. :-)
Hey Patrick,
looks like most of the work has been done for you - this should be close to what you need:
https://www.pdq.com/blog/adding-custom-fields-multiple-computers-powershell/
I got this from raising a support ticket. It pays. :-)