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") %> </td>
<td class="lef"><%=myrow("username") %> </td>
=======================