cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
76012
Engaged Sweeper II
Not really a custom action, but.... I need to search on the username in the computer table. I also want to see the username when the search results are returned.

2 mods were required (nothing was broken..yet...):

1) Tell the search stored procedure to look at username, and add it to the recordset:
=======================
ALTER PROCEDURE [dbo].[web30compsearch](@comp varchar(80))
AS SELECT dbo.tblComputers.Computername, dbo.tblComputers.username, dbo.tblOperatingsystem.Description, dbo.tblComputers.Domain, dbo.tblOperatingsystem.Caption,
CAST(dbo.web30ProcessorCapacity.NrOfProcessors AS varchar) + ' * ' + CAST(dbo.web30ProcessorCapacity.MaxClockSpeed AS varchar)
+ ' Mhz' AS Processor, CAST(CAST(CAST(dbo.tblComputersystem.TotalPhysicalMemory AS bigint) / 1024 / 1024 AS NUMERIC) AS varchar)
+ ' KB' AS Memory, dbo.tblComputers.Lastseen AS [Last seen], CASE ISNULL(dbo.tblOperatingsystem.Description, 'NOT SCANNED')
WHEN 'NOT SCANNED' THEN 1 ELSE 0 END AS Notscanned
FROM dbo.tblComputers LEFT OUTER JOIN
dbo.tblComputersystem ON dbo.tblComputers.Computername = dbo.tblComputersystem.Computername LEFT OUTER JOIN
dbo.web30ProcessorCapacity ON dbo.tblComputers.Computername = dbo.web30ProcessorCapacity.Computername LEFT OUTER JOIN
dbo.tblComputerSystemProduct ON dbo.tblComputers.Computername = dbo.tblComputerSystemProduct.Computername LEFT OUTER JOIN
dbo.tblOperatingsystem ON dbo.tblComputers.Computername = dbo.tblOperatingsystem.Computername
WHERE (dbo.tblComputers.Domain LIKE @comp + '%') OR
(dbo.tblOperatingsystem.Description LIKE @comp + '%') OR
(dbo.tblComputers.Computername LIKE @comp + '%') OR
(dbo.tblComputers.username LIKE @comp + '%') OR
(dbo.tblComputerSystemProduct.IdentifyingNumber = @comp)
ORDER BY dbo.tblComputers.Computername
=======================

2) Modify the results file to show the username:
lansweeperpro\website\it-compsearch.aspx
=======================
' Add the second line below after the Description line
<td valign="middle" class="tblcell">Description</td>
<td valign="middle" class="tblcell">User</td>

' Add the second line below after the Description line
<td class="lef"><%=myrow("Description") %>&nbsp;</td>
<td class="lef"><%=myrow("username") %>&nbsp;</td>

=======================
4 REPLIES 4
76012
Engaged Sweeper II
Yeah...I can't scan the domain controllers, but everything else seems to be fine. All the workstations are XP.
Hemoco
Lansweeper Alumni
You are correct.
Actually Lansweeper doesn't really support NT4.
76012
Engaged Sweeper II
The second box appears to only query the AD table... This particular domain is NT4...so that table is empty. Or, did I miss something?
Hemoco
Lansweeper Alumni
you can also enter the username in the second search field (the one with the user icon)
this will show all the found users + you can click on the computer where the user last logged on.

If only one user matches, you directly jump to the correct computer.