Home Analyst Portal

Query User's Supervisor

Brian_WinterBrian_Winter Customer Advanced IT Monkey ✭✭✭

I'm hoping someone can provide an answer before I figure it out by myself.

Using the Cireson and SCSM databases, is there a query that can pull a User and the User's Supervisor? Just needing names. I suspect there's a darn Relationship table in there somewhere.

TIA

Best Answer

  • Brian_WinterBrian_Winter Customer Advanced IT Monkey ✭✭✭
    Answer ✓

    select a.DisplayName as [User],

    b.DisplayName as Supervisor

    from MT_System$Domain$User a,

    MTV_System$Domain$User b,

    MTV_System$UserManagesUser c,

    Relationship d

    where b.BaseManagedEntityId = d.SourceEntityId

    and a.BaseManagedEntityId = d.TargetEntityId

    and d.RelationshipId = c.RelationshipId

Answers

  • Brian_WinterBrian_Winter Customer Advanced IT Monkey ✭✭✭
    Answer ✓

    select a.DisplayName as [User],

    b.DisplayName as Supervisor

    from MT_System$Domain$User a,

    MTV_System$Domain$User b,

    MTV_System$UserManagesUser c,

    Relationship d

    where b.BaseManagedEntityId = d.SourceEntityId

    and a.BaseManagedEntityId = d.TargetEntityId

    and d.RelationshipId = c.RelationshipId

Sign In or Register to comment.