Getting property name by site name

This does’t work, but I’m wanting to pull the property name and qualifying it by the site name and not the ID of the property. This needs to be able to be run on several root servers where all is the same except for the ID of the property. “site of it” doesn’t work even though that’s how the property manager shows the information.

bes property whose (name of it = "Computer Type" and site of it = "BES Inventory and License")

It looks like there isn’t a great way to pull site of a bes property using session relevance…

Here’s something you could try:

id of <bes property>

With a definition of:

Returns a 3-tuple of integers composed of the site ID, analysis ID and property ID. The first integer identifies the site hosting the Analysis. For custom properties not contained in an analysis (those created using the Manage Properties dialog), it is the ID of the Action site. The second integer indentifies the Analysis containing the property. For custom properties, this is 0. The third integer identifies the property itself. This is the same as the source ID if the property is defined in an Analysis. If it is not defined in an Analysis then this is the unique object ID for the property.

And end up with something like:

(names of it) of bes properties whose (name of it = "Computer Type" and item 0 of id of it = id of bes site whose (name of it contains "BES Support"))
2 Likes

The ID triplicate is certainly one approach (given that this is a property from an external site, the ID should be consistent across BigFix instances). Alternatively, if a property is part of a site (other than actionsite), it must be in an analysis. Therefore, you can return the site associated with the source analysis of the property with something like:

names of bes properties whose (name of it = “Computer Type” AND name of site of source analysis of it = “BES Inventory and License”)

1 Like

@Aram I did try this first I swear! And then Im now editing my post after reading yours a second time

What Aram is getting to is as long as the property you’re looking at is not a reserved property (which in this case it definitely wouldn’t be) and it wasn’t created from the, “Manage Properties” part of the console then it is associated with an analysis and then Aram’s way works better. In the other case, if the property is “reserved” or made via the “Manage Properties” window of the console, then there is no associated analysis.

Example:

Manage Properties:

<?relevance (names of it, name of source analysis of it | "None") of bes properties whose (name of it contains "New Property") ?>

Returns:
Nothing

Reserved Properties:

<?relevance (names of it, name of source analysis of it | "None") of bes properties whose (name of it contains "Computer Type") ?>

Returns:

Computer Type, Wake-on-LAN Analysis
Computer Type, None

Yup! Internal properties (those in actionsite, opsites, or custom sites) are a bit different, and their IDs, and any source analysis objects, are unique to the given BigFix instance (though the names can be the same).

2 Likes

That’s perfect. Know how I get the global/reserved properties in this fashion?

The way I presented above will work for global properties and reserved properties (for reserved look for site ID 2299677890)

I’m a dork. read the top and didn’t fully digest your lower comment. thanks!

ok… that gets me close.

(names of it, name of source analysis of it | "None") of bes properties whose (name of it = "OS" ) 

comes back with 2:

Results
OS, AIX OS Level
OS, None

All I need is “None” one which is the global reserved. Bad code:

(names of it, (name of source analysis of it | "None") whose (it = "None")) of bes properties whose (name of it = "OS" )

With the Global reserved were consistent between environments.

For reserved properties:

names of bes properties whose (reserved flag of it AND name of it = “OS”)

For pre-defined properties:

names of bes properties whose (default flag of it)

4 Likes

Perfect! Thanks again!