Find all your Exchange client access licenses along with the server they are on and the number of users in that license. Client access licenses are used for each device or user which utilizes or accesses Exchange. Lansweeper scans the CAL licenses from an Exchange server and also displays the number of users that are in a specific CAL license. You can also get more information about the user by taking a look at the individual license.
Exchange Licenses Query
Select Top 1000000 'license.png' As Icon,
tblExchangeLicense.LicenseId,
tblExchangeLicense.LicenseName As DisplayName,
Case
When users.cnt Is Null Then 0
Else users.cnt
End As Users,
tblExchangeServer.AssetId As ServerAssetId,
tblExchangeServer.Name As ExchangeServer
From tblExchangeLicense
Inner Join tblExchangeServer On tblExchangeServer.ServerId =
tblExchangeLicense.ServerId
Left Outer Join (Select Count(tblExchangeUserLicense.UserId) As cnt,
tblExchangeUserLicense.LicenseId
From tblExchangeUserLicense
Group By tblExchangeUserLicense.LicenseId) users On users.LicenseId =
tblExchangeLicense.LicenseId
Where tblExchangeLicense.UnitLabel = 'CAL'
Order By DisplayName