Database Reference
In-Depth Information
vManagedEntity ME
INNER JOIN vManagedEntityType MET ON
ME.ManagedEntityTypeRowId = MET.ManagedEntityTypeRowId
INNER JOIN vManagementPack MP ON
MET.ManagementPackRowId = MP.ManagementPackRowId
WHERE
MP.ManagementPackSystemName = 'Microsoft.Windows.Library'
vRelationship
You can use the
vRelationship
view to retrieve group membership information for
managed entities. The
vRelationship
view contains
SourceMan-
agedEntityRowId
and
TargetManagedEntityRowId
; both properties can be
used to join to the
vManagedEntity
view.
You can also use the
vRelationshipType
view and join it to the
vRelationship
view on the
RelationshipTypeRowId
column to retrieve information about the type
of relationship between two managed entities.
In the following example, we will retrieve a list of all entity types that relate to an instance
of the
Microsoft.Windows.Computer
managed entity type. You can use the
sample query from the
vManagedEntityType
section earlier in this recipe to retrieve a list
of all the managed entities of the
Microsoft.Windows.Computer
type.
Pick any of these computers and replace the value for
SourceManagedEntityRowId
in the following script with
ManagedEntityRowId
of a computer in your environ-
ment:
SELECT
ME.ManagedEntityRowId,
ME.ManagedEntityDefaultName,
MET.ManagedEntityTypeDefaultName,
RT.RelationshipTypeDefaultName
FROM
vRelationship R
INNER JOIN vRelationshipType RT ON
R.RelationshipTypeRowId = RT.RelationshipTypeRowId
INNER JOIN vManagedEntity ME ON
R.TargetManagedEntityRowId = ME.ManagedEntityRowId