cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Kreg
Engaged Sweeper II
Hi there,

I need to create a very simple report to show all of my users for 2 mails domain, and without "prestataire, interimaire and stagiaire".
Easy, yes my report works, but I don't know why I've some users duplication.
I have only 3 columns with unique entry, so what ?

Here is my query, if you have an idea 🙂

Select Top 1000000 tblAssets.AssetID,
tblAssets.Username,
tblADusers.Firstname,
tblADusers.Lastname,
tblADusers.email
From tblAssets
Left Join tblADusers On tblADusers.Username = tblAssets.Username And
tblADusers.Userdomain = tblAssets.Userdomain
Where tblAssets.Username Is Not Null And tblADusers.Firstname Is Not Null And
tblADusers.Lastname Is Not Null And tblADusers.Lastname Not Like
'%PRESTATAIRE%' And tblADusers.Lastname Not Like '%STAGIAIRE%' And
tblADusers.Lastname Not Like '%INTERIMAIRE%' And
((tblADusers.email Is Not Null And tblADusers.email Like '%MyDomain1%') Or
tblADusers.email Like '%MyDomain2%')


Many thanks,
Kreg
1 ACCEPTED SOLUTION
Susan_A
Lansweeper Alumni
You've linked tblADusers to tblAssets, which stores asset data. You are listing all of your assets and the user details of the last user to be logged into each asset. If a user account is the last logged on user of multiple assets, it will be listed multiple times, once for each asset.

If you are simply trying to report on AD user information, there's no need to include tblAssets. Remove the table from your report by, in the visual representation of the report in the upper section of the report builder, hitting the in the upper right corner of the table.

View solution in original post

3 REPLIES 3
Susan_A
Lansweeper Alumni
An AD user's status (enabled/disabled) cannot be included in reports, as this information isn't stored in the database. You can however have stale user accounts removed from the database by enabling the appropriate database cleanup option under Configuration\Scanning Setup\Server Options. Cleanups are performed when the Lansweeper Server service is started and subsequently every 24 hours.
Kreg
Engaged Sweeper II
Oh yes, you are right! Thanks 🙂

Now, i haven't got duplicate.
But I guess it's remaining some "non active" users.
Is there any way to hide non active users like it's possible to hide non active computer ?

Thanks again,
Kreg
Susan_A
Lansweeper Alumni
You've linked tblADusers to tblAssets, which stores asset data. You are listing all of your assets and the user details of the last user to be logged into each asset. If a user account is the last logged on user of multiple assets, it will be listed multiple times, once for each asset.

If you are simply trying to report on AD user information, there's no need to include tblAssets. Remove the table from your report by, in the visual representation of the report in the upper section of the report builder, hitting the in the upper right corner of the table.