We’re currently experiencing a high volume of support requests, which may result in longer response times — Thank you for your patience and understanding.
Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kas
Engaged Sweeper II
Hello -

I have been able to add support for some of the other suppliers that our company uses, but I am running into a roadblock when it comes to HP.

I found out that if I call the following URL "http://h20180.www2.hp.com/apps/Lookup?h_pagetype=s-001&lang=en&cc=us&h_lang=en&h_cc=en&&h_query="Model" I can pull up the specifications for the laptop via HP's website.

What I'd need to know, is, how to make a If/else clause in the it-compdetail.aspx page to allow me to keep the Normal Vendor Support Link to use the {assettag} field for all of the computers instead of the HP computers which would, instead, use the {model} tag.

Thanks!
11 REPLIES 11
Hemoco
Lansweeper Alumni
This feature is implemented in our next version 3.5 : you can test the beta from
http://www.lansweeper.com/forum/yaf_topics18_Lansweeper-35-Beta-testing.aspx
yakir
Engaged Sweeper
you can use the following link, but it will only work for desktops/laptops:

http://www-307.ibm.com/pc/support/site.wss/quickPath.do?sitestyle=lenovo&quickPathEntry={model}
ueteam
Engaged Sweeper
Where does the code go? I would like to have this for IBM servers as well.

Thanks,
Herman
tdewar1
Engaged Sweeper
Kyle:

That was perfect! Thank you so much. Now I can look up my HPs, my Lenovos and my Dells. Of course now I wish HP and Lenovo would get with the program and have the fully support info by serial number like Dell has, but that is way beyond our control. 🙂

Thanks Again!
Tom
helpdesk5
Engaged Sweeper
Actually -

I needed to look back at my post here when I upgraded to the newest version, and to a new server.

The file that I changed was: it-compdetail.aspx

My changed file is as follows:



<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="utf-8" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM:DataSet
runat="Server"
id="dscomputers"
IsStoredProcedure="true"
CreateDataSet="true"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_Lansweeper") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_Lansweeper") %>'
CommandText="dbo.Web301comp"
CurrentPage='<%# IIf((Request.QueryString("dscomputers_CurrentPage") <> Nothing), Request.QueryString("dscomputers_CurrentPage"), 0) %>'
PageSize="25"
Debug="true"
><Parameters>
<Parameter Name="@RETURN_VALUE" Type="Int" Direction="ReturnValue" />
<Parameter Name="@comp" Value='<%# request("comp") %>' Type="VarChar" Direction="Input" />
</Parameters></MM:DataSet>
<MM:DataSet
runat="Server"
id="dswol"
IsStoredProcedure="true"
CreateDataSet="true"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_Lansweeper") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_Lansweeper") %>'
CommandText="dbo.web30getWOL"
Debug="true"
>
<Parameters>
<Parameter Name="@RETURN_VALUE" Type="Int" Direction="ReturnValue" />
<Parameter Name="@comp" Value='<%# request("comp") %>' Type="VarChar" Direction="Input" />
</Parameters>
</MM:DataSet>
<MM:DataSet
runat="Server"
id="dsasset"
IsStoredProcedure="true"
CreateDataSet="true"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_Lansweeper") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_Lansweeper") %>'
CommandText="dbo.web30getasset"
Debug="true"
>
<Parameters>
<Parameter Name="@RETURN_VALUE" Type="Int" Direction="ReturnValue" />
<Parameter Name="@vendor" Value='<%# dscomputers.FieldValue("Vendor", nothing) %>' Type="VarChar" Direction="Input" />
</Parameters>
</MM:DataSet>
<MM:DataSet
runat="Server"
id="dwActiveDirectory"
IsStoredProcedure="true"
CreateDataSet="true"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_Lansweeper") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_Lansweeper") %>'
CommandText="dbo.Web30GetAD"
Debug="true"
>
<Parameters>
<Parameter Name="@RETURN_VALUE" Type="Int" Direction="ReturnValue" />
<Parameter Name="@comp" Value='<%# request("comp") %>' Type="VarChar" Direction="Input" />
</Parameters>
</MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<link href="css/ls.css" rel="stylesheet" type="text/css">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/computerbig.gif" width="50" height="50" hspace="4" /></td>
<td><table border="0" cellspacing="2" cellpadding="0">
<tr>
<td class="lijntje"><font size="4"><strong><%=request("comp")%> (<%# dscomputers.FieldValue("Description", Container) %>)</strong></font></td>
</tr>
<tr>
<td><span class="bigt" >Action screen </span></td>
</tr>
</table></td>
</tr>
</table>
<%server.execute("inc-comptitel.aspx?" & request.ServerVariables("QUERY_STRING"))%>
<table border="0" cellspacing="4" cellpadding="0">
<tr>
<td rowspan="5" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="2" class="box">
<tr>
<td><%server.execute("actions.aspx?" & request.ServerVariables("QUERY_STRING") & "&domain=" & dscomputers.FieldValue("Domain", nothing) & "&username=" & dscomputers.FieldValue("username", nothing) & "&userdomain=" & dscomputers.FieldValue("userdomain", nothing) & "&tag=" & dscomputers.FieldValue("tag", nothing) )%></td>
</tr>
</table><br /></td>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="2" class="box">
<tr>
<td valign="top"><table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF" class="borderbox">
<% Dim tel As Integer
Dim mycolumn As System.Data.DataColumn
Dim myrow As System.Data.DataRow
myrow = dscomputers.DefaultView.Table.Rows(0)
tel = 1%>
<% For Each mycolumn In dscomputers.DefaultView.Table.Columns%>
<%if lcase(mycolumn.Caption) <> "notscanned" and lcase(mycolumn.Caption) <> "lastseen" and lcase(mycolumn.Caption)<> "username" and lcase(mycolumn.Caption)<> "userdomain" and lcase(mycolumn.Caption)<> "displayname" then%>
<tr <%if (tel mod 2) = 0 then%>class="ne"<%end if%>>
<td align="right" class="lijntje"><strong><%=mycolumn.Caption %>:</strong>&nbsp;</td>
<td class="lijntje"><%=myrow(mycolumn.Caption)%>&nbsp;</td>
</tr>
<%tel = tel + 1%>
<%end if%>
<%next%>
</table></td>
<td valign="top"><table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF" class="borderbox">
<tr>
<td align="right" class="lijntje"><strong>Last seen:</strong>&nbsp;</td>
<td class="lijntje"><%# dscomputers.FieldValue("Lastseen", Container) %></td>
</tr>
<tr class="ne">
<td align="right" class="lijntje"><strong>Domain:</strong>&nbsp;</td>
<td class="lijntje"><%# dscomputers.FieldValue("Userdomain", Container) %>&nbsp;</td>
</tr>
<tr >
<td align="right" class="lijntje"><strong>Username:</strong>&nbsp;</td>
<td class="lijntje"><%# dscomputers.FieldValue("Username", Container) %>&nbsp;</td>
</tr>
<tr class="ne">
<td colspan="2" align="center" valign="top" class="lijntje"><a href="default.aspx?item=userdetail&amp;username=<%# dscomputers.FieldValue("Username", Container) %>&amp;userdomain=<%# dscomputers.FieldValue("userdomain", Container) %>"><img src="smallthumb.aspx?user=<%# dscomputers.FieldValue("Username", Container) %>&amp;domain=<%# dscomputers.FieldValue("Userdomain", Container) %>&amp;size=150" border="0" class="picbox"></a></td>
</tr>
<tr >
<td colspan="2" align="center" valign="top" class="lijntje"><a href="default.aspx?item=userdetail&amp;username=<%# dscomputers.FieldValue("Username", Container) %>&amp;userdomain=<%# dscomputers.FieldValue("userdomain", Container) %>"><%# dscomputers.FieldValue("Displayname", Container) %></a></td>
</tr>
</table></td>
</tr>
</table> </td>
</tr>
<tr>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="2" class="box">
<tr>
<td valign="top"><table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF" class="borderbox">
<tr >
<td width="16" class="lijntje"><img src="icons/AD.gif" width="16" height="16" /></td>
<td width="100%" class="lijntje"><strong>Active Directory information</strong></td>
</tr>
<tr>
<td colspan="2" class="lijntje"><table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF">
<tr class="ne">
<td align="right" class="lijntje"><strong>FQDN:</strong>&nbsp;</td>
<td class="lijntje"><%# dwActiveDirectory.FieldValue("DNSHostname", Container) %>&nbsp;</td>
</tr>
<tr >
<td align="right" class="lijntje"><strong>Description:</strong>&nbsp;</td>
<td width="100%" class="lijntje"><%# dwActiveDirectory.FieldValue("Description", Container) %>&nbsp;</td>
</tr>
<tr >
<td align="right" class="lijntje"><strong>Location:</strong>&nbsp;</td>
<td width="100%" class="lijntje"><%# dwActiveDirectory.FieldValue("Location", Container) %>&nbsp;</td>
</tr>
<tr class="ne" >
<td align="right" class="lijntje"><strong>Company:</strong>&nbsp;</td>
<td width="100%" class="lijntje"><%# dwActiveDirectory.FieldValue("Company", Container) %>&nbsp;</td>
</tr>
<tr >
<td align="right" class="lijntje"><strong>OU:</strong>&nbsp;</td>
<td class="lijntje"><%# dwActiveDirectory.FieldValue("OU", Container) %>&nbsp;</td>
</tr>
<tr class="ne" >
<td align="right" class="lijntje"><strong>Comments:</strong>&nbsp;</td>
<td class="lijntje"><%# dwActiveDirectory.FieldValue("Comment", Container) %>&nbsp;</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr><%if dsasset.recordcount <> 0 then%>
<tr>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="2" class="box">
<tr>
<td valign="top"><table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF" class="borderbox">
<%tel=1%>
<tr <%if (tel mod 2) = 0 then%>class="ne"<%end if%>>
<td class="lijntje"><img src="icons/people.gif" width="16" height="16" /></td>
<td class="lijntje"><strong>Vendor support link</strong></td>
</tr>
<%
tel = 2%>
<% For Each myrow In dsasset.DefaultView.Table.Rows%>
<tr <%if (tel mod 2) = 0 then%>class="ne"<%end if%>>
<td width="16" class="lijntje"><img src="icons/assettag.gif" width="16" height="16" /></td>
<% If (myrow("vendor") = "HP") Or (myrow("vendor") = "Hewlett-Packard") Then%>
<td class="lijntje"><a href="<%=replace(myrow("assetlink"),"{model}",dscomputers.FieldValue("Model", nothing))%>" target="_blank"><%=myrow("vendor")%> : <%# dscomputers.FieldValue("Model", Container) %></a></td>
<% Else%>
<td class="lijntje"><a href="<%=replace(myrow("assetlink"),"{assettag}",dscomputers.FieldValue("Tag", nothing))%>" target="_blank"><%=myrow("vendor")%> : <%# dscomputers.FieldValue("Tag", Container) %></a></td>
<% End If %>
</tr>
<%tel = tel + 1%>
<%next%>
</table></td>
</tr>
</table></td>
</tr><%end if%>
<%if dswol.recordcount <> 0 then%><tr>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="2" class="box">
<tr>
<td valign="top"><table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF" class="borderbox">
<%tel=1%>
<tr <%if (tel mod 2) = 0 then%>class="ne"<%end if%>>
<td class="lijntje"><img src="icons/network.gif" width="16" height="16" /></td>
<td class="lijntje"><strong>Network Wake On Lan </strong></td>
<td class="lijntje"><strong>Mac Address </strong></td>
</tr>
<%
tel = 2%>
<% For Each myrow In dswol.DefaultView.Table.Rows%>
<tr <%if (tel mod 2) = 0 then%>class="ne"<%end if%>>
<td width="16" class="lijntje"><img src="icons/device.gif" width="16" height="16" /></td>
<td class="lijntje"><a href="javascript:runApp('\\\\stingray\\Support\\Private\\IT Programs\\LSTools\\wol.exe <%=replace(myrow("macaddress"),":","")%>','true');"><%=myrow("description")%></a>&nbsp;</td>
<td class="lijntje"><%=myrow("macaddress")%>&nbsp;</td>
</tr>
<%tel = tel + 1%>
<%next%>
</table></td>
</tr>
</table></td>
</tr><%end if%>
<tr>
<td valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="2" class="box">
<tr>
<td valign="top"><%server.execute("compindashboard.aspx?" & request.ServerVariables("QUERY_STRING"))%></td>
<td valign="top"><%server.execute("scannedpc.aspx?" & request.ServerVariables("QUERY_STRING"))%></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>




The specific Change was made to:



<% If (myrow("vendor") = "HP") Or (myrow("vendor") = "Hewlett-Packard") Then%>
<td class="lijntje"><a href="<%=replace(myrow("assetlink"),"{model}",dscomputers.FieldValue("Model", nothing))%>" target="_blank"><%=myrow("vendor")%> : <%# dscomputers.FieldValue("Model", Container) %></a></td>
<% Else%>
<td class="lijntje"><a href="<%=replace(myrow("assetlink"),"{assettag}",dscomputers.FieldValue("Tag", nothing))%>" target="_blank"><%=myrow("vendor")%> : <%# dscomputers.FieldValue("Tag", Container) %></a></td>
<% End If %>



Since the HP Laptops & Servers use the {model} instead of the {assettag} the IF / Else clause was added to query the DB for the {model} of "HP" or "Hewlett-Packard".

In the DB itself, I added the following two lines for HP (tsysassetlinks)
Hewlett-Packard http://h20180.www2.hp.com/apps/Lookup?h_pagetype=s-001&lang=en&cc=us&h_lang=en&h_cc=en&&h_query={model}
HP http://h20180.www2.hp.com/apps/Lookup?h_pagetype=s-001&lang=en&cc=us&h_lang=en&h_cc=en&&h_query={model}

HP uses a really confusing search pattern that formats the link returned from the search to something unusable to Lansweeper's search.

I have a few IBM servers that I wasn't able to figure out how to actually search for. Any ideas on that? If IBM uses the model tag as well, you should just be able to add


If (myrow("vendor") = "HP") Or (myrow("vendor") = "Hewlett-Packard") Or (myrow("vendor") = "IBM") Or (myrow("vendor") = "Lenovo")


To the first If Statement


Hope this helps.

-Kyle
tdewar1
Engaged Sweeper
I am not following where to add the code KAS suggests. I have HP PCs and servers, so I would love to get this working if possible. Also, has anyone gotten IBM/Lenovo working? It looks to me like they use model as well.
Hemoco
Lansweeper Alumni
As long as you know what you're doing it's ok 😉
kas
Engaged Sweeper II
Simple, yet effective solution:

<% If (myrow("vendor") = "HP") Or (myrow("vendor") = "Hewlett-Packard") Then%>
<td class="lijntje"><a href="<%=replace(myrow("assetlink"),"{model}",dscomputers.FieldValue("Model", nothing))%>" target="_blank"><%=myrow("vendor")%> : <%# dscomputers.FieldValue("Model", Container) %></a></td>

<% Else%>

<td class="lijntje"><a href="<%=replace(myrow("assetlink"),"{assettag}",dscomputers.FieldValue("Tag", nothing))%>" target="_blank"><%=myrow("vendor")%> : <%# dscomputers.FieldValue("Tag", Container) %></a></td>

<% End If %>

A If / Else edit to format the link to the HP site, only if the Vendor equals HP or Hewlett-Packard, it will then format the Vendor Support link to use the Model, instead of the Tag. If any other computer is queried, and it is in the asset tag links config, it will pull the data from the tag, just like normal.
Hemoco
Lansweeper Alumni
I'll move this to the wish list for the next version

Archive

This board contains archived posts from the retired Lansweeper Forum and Insiders Community.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now