SQL Query for Assets Primary User
Best Answer
-
charlemagne_abonado Cireson Dev IT Monkey ✭Hi Cody,
Can you try this query below?
This is looking on hardware asset table, relationship table, RelationshipType Type and MT_Microsoft$AD$UserBase table.SELECT TOP 1000 HW.BaseManagedEntityId,HW.DisplayName,Rel.TargetEntityId,UB.OrganizationalUnit_13D8EA29_A659_92AE_C78F_8047469D8C96,UB.UPN_7641DFF7_7A20_DC04_FC1C_B6FA8715DA02FROM MT_Cireson$AssetManagement$HardwareAsset HWinner join Relationship Rel on HW.BaseManagedEntityId = Rel.SourceEntityIdinner join RelationshipType RT on RT.RelationshipTypeId = Rel.RelationshipTypeIdinner join MT_Microsoft$AD$UserBase UB on UB.BaseManagedEntityId = Rel.TargetEntityIdwhere RT.RelationshipTypeName = 'Cireson.AssetManagement.HardwareAssetHasPrimaryUser'
Thanks5
Answers
Can you try this query below?
This is looking on hardware asset table, relationship table, RelationshipType Type and MT_Microsoft$AD$UserBase table.
Thanks