getting relationships of config items
Hi,
I need to call the class properties and relationships of config items (Hardware Assets). I get the properties all right through the GetProjectionByCriteria API but it only returns me one relationship for some reason, if any at all. What could be the reason and how do I get all of the relationships of a HW asset?
Best Answer
-
Geoff_Ross Cireson Consultant O.G.Hi @Mehwish_Shahid
This call will return all the relationships defined in the projection that you provide in the Id param with a Type Projection Id.
Try using the hardware asset (full) projection id - 7dd5144c-bd5d-af27-e3af-debcb5a53546
Geoff5
Answers
Using SMLets in PowerShell, you can do the following to see all the available type projections for that class:
Obviously, remove the brackets when you type your SCSM server name above. Note that the "Name" parameter finds matching strings, rather than an exact match. This is perfect for your situation, but you can type the exact projection name (or use the -Id param) with a dollar sign ($) at the end if you want an exact match some other time.
You will get a list of type projections (the name is the ProjectionType property), each showing a list of the different relationships that they include.
If by some chance you do not see one that contains all the relationships you need, you can always make your own. There are several older posts in this forum that delve into that, plus lots to be found by searching Google, but there are a few of us around here that could probably answer specifics if needed too.
This call will return all the relationships defined in the projection that you provide in the Id param with a Type Projection Id.
Try using the hardware asset (full) projection id - 7dd5144c-bd5d-af27-e3af-debcb5a53546
Geoff