This command will list users with their respective default departments and positions.
Related tables
Table
Description
Primary key (PK)
Connection tables
ADALLUSERS
Stores uses
CDUSER
ADALLUSERS
ADUSEREXTERNALDATA
GNFAVORITE
ADUSERDEPTPOS
Stores the relationship between departments, positions, and users
CDUSER
CDDEPARTMENT
CDPOSITION
ADALLUSERS
ADDEPTPOSITION
ADDEPARTMENT
Stores organizational units and departments
CDDEPARTMENT
ADALLUSERS
ADDEPARTMENT
ADTEAM
COWORKSPACE
GNASSOC
GNFAVORITE
GNMAPPING
ADPOSITION
Stores positions
CDPOSITION
GNMAPPING
Oracle/Postgres/SQL Server
SELECT AD.NMUSER, ADA.NMDEPARTMENT, ADF.NMPOSITION FROM ADALLUSERS AD INNERJOIN ADUSERDEPTPOS UDP ON (AD.CDUSER = UDP.CDUSER) INNERJOIN ADDEPARTMENT ADA ON (ADA.CDDEPARTMENT = UDP.CDDEPARTMENT) INNERJOIN ADPOSITION ADF ON (ADF.CDPOSITION = UDP.CDPOSITION) WHERE UDP.FGDEFAULTDEPTPOS = 1;