‎01-15-2019 10:33 PM
Solved! Go to Solution.
‎01-31-2019 06:37 PM
Charles.X wrote:
As far as mapped drives info, the table contains information about a Windows computer's mapped drives. Only persistent mapped drives found in the client machine's registry under HKEY_CURRENT_USER\Network are scanned.
In the report above though, you're looking at the mapped drives of that computer, not necessarily of the user listed, I think you can only see the user linked to the mapped drive from tblMappedDrives.Username. However, this can't be mapped to tbladusers, because the username format for the two tables is different.
tbladusers.username = Username
tblmappeddrives.username = Domain\Username
There is a way to go around this by using the substring of the mapped drive table to join the two tables. Depending on the length of you domain name you'll have to modify the report. In my test case, the domain has two letters, so the value in tblmappeddrives.username = AB\John.Doe
To just get John.Doe back I had to let the substring start at position 4 (length of the substring is 20 characters, you can increase this if you have long usernames)Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Username,
tblADusers.Firstname,
tblADusers.Lastname,
tblAssets.IPAddress,
tblMappedDrives.Driveletter,
tblMappedDrives.RemotePath,
From tblAssets
Inner Join tblMappedDrives On tblAssets.AssetID = tblMappedDrives.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblADusers On
tblADusers.Username = SubString(tblMappedDrives.Username, 4, 20)
Where tblAssets.Username = SubString(tblMappedDrives.Username, 4, 20)
Order By tblAssets.AssetName,
tblMappedDrives.Driveletter
‎01-30-2019 05:23 PM
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Username,
tblADusers.Firstname,
tblADusers.Lastname,
tblAssets.IPAddress,
tblMappedDrives.Driveletter,
tblMappedDrives.RemotePath,
From tblAssets
Inner Join tblMappedDrives On tblAssets.AssetID = tblMappedDrives.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblADusers On
tblADusers.Username = SubString(tblMappedDrives.Username, 4, 20)
Where tblAssets.Username = SubString(tblMappedDrives.Username, 4, 20)
Order By tblAssets.AssetName,
tblMappedDrives.Driveletter
‎01-31-2019 06:37 PM
Charles.X wrote:
As far as mapped drives info, the table contains information about a Windows computer's mapped drives. Only persistent mapped drives found in the client machine's registry under HKEY_CURRENT_USER\Network are scanned.
In the report above though, you're looking at the mapped drives of that computer, not necessarily of the user listed, I think you can only see the user linked to the mapped drive from tblMappedDrives.Username. However, this can't be mapped to tbladusers, because the username format for the two tables is different.
tbladusers.username = Username
tblmappeddrives.username = Domain\Username
There is a way to go around this by using the substring of the mapped drive table to join the two tables. Depending on the length of you domain name you'll have to modify the report. In my test case, the domain has two letters, so the value in tblmappeddrives.username = AB\John.Doe
To just get John.Doe back I had to let the substring start at position 4 (length of the substring is 20 characters, you can increase this if you have long usernames)Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Username,
tblADusers.Firstname,
tblADusers.Lastname,
tblAssets.IPAddress,
tblMappedDrives.Driveletter,
tblMappedDrives.RemotePath,
From tblAssets
Inner Join tblMappedDrives On tblAssets.AssetID = tblMappedDrives.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblADusers On
tblADusers.Username = SubString(tblMappedDrives.Username, 4, 20)
Where tblAssets.Username = SubString(tblMappedDrives.Username, 4, 20)
Order By tblAssets.AssetName,
tblMappedDrives.Driveletter
‎01-31-2019 06:11 PM
Charles.X wrote:
As far as mapped drives info, the table contains information about a Windows computer's mapped drives. Only persistent mapped drives found in the client machine's registry under HKEY_CURRENT_USER\Network are scanned.
In the report above though, you're looking at the mapped drives of that computer, not necessarily of the user listed, I think you can only see the user linked to the mapped drive from tblMappedDrives.Username. However, this can't be mapped to tbladusers, because the username format for the two tables is different.
tbladusers.username = Username
tblmappeddrives.username = Domain\Username
There is a way to go around this by using the substring of the mapped drive table to join the two tables. Depending on the length of you domain name you'll have to modify the report. In my test case, the domain has two letters, so the value in tblmappeddrives.username = AB\John.Doe
To just get John.Doe back I had to let the substring start at position 4 (length of the substring is 20 characters, you can increase this if you have long usernames)Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Username,
tblADusers.Firstname,
tblADusers.Lastname,
tblAssets.IPAddress,
tblMappedDrives.Driveletter,
tblMappedDrives.RemotePath,
From tblAssets
Inner Join tblMappedDrives On tblAssets.AssetID = tblMappedDrives.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblADusers On
tblADusers.Username = SubString(tblMappedDrives.Username, 4, 20)
Where tblAssets.Username = SubString(tblMappedDrives.Username, 4, 20)
Order By tblAssets.AssetName,
tblMappedDrives.Driveletter
‎01-30-2019 06:12 PM
Charles.X wrote:
As far as mapped drives info, the table contains information about a Windows computer's mapped drives. Only persistent mapped drives found in the client machine's registry under HKEY_CURRENT_USER\Network are scanned.
In the report above though, you're looking at the mapped drives of that computer, not necessarily of the user listed, I think you can only see the user linked to the mapped drive from tblMappedDrives.Username. However, this can't be mapped to tbladusers, because the username format for the two tables is different.
tbladusers.username = Username
tblmappeddrives.username = Domain\Username
There is a way to go around this by using the substring of the mapped drive table to join the two tables. Depending on the length of you domain name you'll have to modify the report. In my test case, the domain has two letters, so the value in tblmappeddrives.username = AB\John.Doe
To just get John.Doe back I had to let the substring start at position 4 (length of the substring is 20 characters, you can increase this if you have long usernames)Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Username,
tblADusers.Firstname,
tblADusers.Lastname,
tblAssets.IPAddress,
tblMappedDrives.Driveletter,
tblMappedDrives.RemotePath,
From tblAssets
Inner Join tblMappedDrives On tblAssets.AssetID = tblMappedDrives.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblADusers On
tblADusers.Username = SubString(tblMappedDrives.Username, 4, 20)
Where tblAssets.Username = SubString(tblMappedDrives.Username, 4, 20)
Order By tblAssets.AssetName,
tblMappedDrives.Driveletter
‎01-22-2019 11:09 AM
‎01-30-2019 04:41 PM
Charles.X wrote:
Add the table tbladusers and the following fields:
tblADusers.firstname
tblADusers.lastname
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now