cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sayed_awad
Engaged Sweeper
I want to create report for unmoved computers with user name and USER OU
I create it but I want to add user OU in report

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblADComputers.OU,
tblAssets.Username
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Where tblADComputers.OU = 'CN=Computers,DC=EG01,DC=Etisalat,DC=net' And
tblAssetCustom.State = 1
1 ACCEPTED SOLUTION
Daniel_B
Lansweeper Alumni
AD users are stored in tblADusers. You need to add this table to your report and manually join it (drag and drop tblAssets.Username and tblAsssets.Userdomain to their corresponding fields in tblADusers). Now you are able to select tblADusers.OU. We recommend that you have a look at the Database Dictionary as this helps you searching for the location of specific information in the Lansweeper database.

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblADComputers.OU,
tblAssets.Username,
tblADusers.OU As [User OU]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Left Join tblADusers On tblADusers.Username = tblAssets.Username And
tblADusers.Userdomain = tblAssets.Userdomain
Where tblADComputers.OU = 'CN=Computers,DC=EG01,DC=Etisalat,DC=net' And
tblAssetCustom.State = 1

View solution in original post

1 REPLY 1
Daniel_B
Lansweeper Alumni
AD users are stored in tblADusers. You need to add this table to your report and manually join it (drag and drop tblAssets.Username and tblAsssets.Userdomain to their corresponding fields in tblADusers). Now you are able to select tblADusers.OU. We recommend that you have a look at the Database Dictionary as this helps you searching for the location of specific information in the Lansweeper database.

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblADComputers.OU,
tblAssets.Username,
tblADusers.OU As [User OU]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Left Join tblADusers On tblADusers.Username = tblAssets.Username And
tblADusers.Userdomain = tblAssets.Userdomain
Where tblADComputers.OU = 'CN=Computers,DC=EG01,DC=Etisalat,DC=net' And
tblAssetCustom.State = 1