‎08-09-2017 01:29 PM
Select Top 1000000 htblusers.name As [User],
htblusers.username,
htblusers.userdomain,
htblusers.email As Email,
htblusers.mobile,
htblusers.telephone,
htblusers.company,
htblusers.department,
tsysLanguages.EnglishName As Language,
tsysRoles.Name As Role,
Case When htblusers.userid = htblagents.userid Then 'Agent' Else 'User'
End As AgentOrUser,
Case htblagents.active When 1 Then 'Yes' Else 'No' End As IsLicensed
From htblusers
Left Join tsysRoles On htblusers.Roleid = tsysRoles.RoleID
Left Join htblagents On htblusers.userid = htblagents.userid
Inner Join tsysLanguages On tsysLanguages.LanguageId = htblusers.language
Where htblusers.name <> 'System'
Order By [User]
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now