
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2008 09:54 PM
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>
=======================
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>
=======================
Labels:
- Labels:
-
Custom Actions
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2008 12:34 AM
Yeah...I can't scan the domain controllers, but everything else seems to be fine. All the workstations are XP.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2008 11:31 PM
You are correct.
Actually Lansweeper doesn't really support NT4.
Actually Lansweeper doesn't really support NT4.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2008 11:27 PM
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?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2008 11:07 PM
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.
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.
