Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I will try to explain what exactly I am after this time: Please bare over with me. My english isn't perfect.

The starting point for all users when they go on Internet is the Intranet start page.

When I need to help my users, I need to know either their computer name or Ip-address in order to be able to remote control their computer.

The problem is that a lot of my customers isn't very computer savvy. They don't know how to get back to the desktop, or to view their computer name / ip-adress.

That is something I would like to help them with.

Is it hard to create a beautiful "box" on my Intranet-page which is easily visible, and shows the computer name / ip-address?

Bare in mind that I am not very proficient when it comes to Sharepoint.

Any good advice highly appreciated.

share|improve this question

1 Answer 1

I've used the IIS Server variable REMOTE_ADDR in data view web parts to show/hide information to users based on their IP Address. So you could create a data view web part that points to any list or library (it's irrelevant because we wouldn't be showing any of that data) and just out put the IP address of the user.

A quick dirty example:

<WebPartPages:DataFormWebPart runat="server" IsIncluded="True" FrameType="None" NoDefaultStyle="TRUE" ViewFlag="0" Title="Loop" __markuptype="vsattributemarkup" __WebPartId="{F3A22C73-60C4-44D9-AA52-2C979C7CD2B6}" id="g_f3a22c73_60c4_44d9_aa52_2c979c7cd2b6" pagesize="1">
    <DataSources><SharePoint:SPDataSource runat="server" DataSourceMode="List" UseInternalName="true" selectcommand="&lt;View&gt;&lt;/View&gt;" id="dataformwebpart2"><SelectParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{1858597C-BEFE-42AF-B52A-C8A89B519F45}"/><asp:Parameter Name="MaximumRows" DefaultValue="1"/></SelectParameters><DeleteParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{1858597C-BEFE-42AF-B52A-C8A89B519F45}"/></DeleteParameters><UpdateParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{1858597C-BEFE-42AF-B52A-C8A89B519F45}"/></UpdateParameters><InsertParameters><WebPartPages:DataFormParameter Name="ListID" ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{1858597C-BEFE-42AF-B52A-C8A89B519F45}"/></InsertParameters></SharePoint:SPDataSource></DataSources>

    <datafields>@Title,Title;@theDate,theDate;@ID,ID;@ContentType,Content Type;@Modified,Modified;@Created,Created;@Author,Created By;@Editor,Modified By;@_UIVersionString,Version;@Attachments,Attachments;@File_x0020_Type,File Type;@FileLeafRef,Name (for use in forms);@FileDirRef,Path;@FSObjType,Item Type;@_HasCopyDestinations,Has Copy Destinations;@_CopySource,Copy Source;@ContentTypeId,Content Type ID;@_ModerationStatus,Approval Status;@_UIVersion,UI Version;@Created_x0020_Date,Created;@FileRef,URL Path;</datafields>
    <XSL><xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
    <xsl:output method="html" indent="no"/>
    <xsl:decimal-format NaN=""/>
                                <xsl:param name="dvt_apos">'</xsl:param>
    <xsl:param name="ListID">{1858597C-BEFE-42AF-B52A-C8A89B519F45}</xsl:param>
    <xsl:param name="Param1" />
                                <xsl:variable name="dvt_1_automode">0</xsl:variable>

                                <xsl:template match="/">
                                                <xsl:call-template name="dvt_1"/>
    </xsl:template>
                                <xsl:template name="dvt_1">
                                                <xsl:variable name="dvt_StyleName">Table</xsl:variable>
                                                <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
                                                <xsl:variable name="RowLimit" select="1" />
        <table border="0" width="100%" cellpadding="2" cellspacing="0">
            <tr valign="top">
                            <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
                    <th class="ms-vh" width="1%" nowrap="nowrap"></th>
                </xsl:if>

            </tr>
                        <xsl:call-template name="dvt_1.body">
                                        <xsl:with-param name="Rows" select="$Rows"/>
                                        <xsl:with-param name="FirstRow" select="1" />
                                        <xsl:with-param name="LastRow" select="$RowLimit" />
                        </xsl:call-template>
        </table>

    </xsl:template>
                                <xsl:template name="dvt_1.body">
                                                <xsl:param name="Rows"/>
                                                <xsl:param name="FirstRow" />
                                                <xsl:param name="LastRow" />
                                                <xsl:for-each select="$Rows">
                                                                <xsl:variable name="dvt_KeepItemsTogether" select="false()" />
                                                                <xsl:variable name="dvt_HideGroupDetail" select="false()" />
                                                                <xsl:if test="(position() &gt;= $FirstRow and position() &lt;= $LastRow) or $dvt_KeepItemsTogether">
                                                                                <xsl:if test="not($dvt_HideGroupDetail)" ddwrt:cf_ignore="1">
                                                                                                <xsl:call-template name="dvt_1.rowview" />
                                                                                </xsl:if>
                                                                </xsl:if>
        </xsl:for-each>

    </xsl:template>
                                <xsl:template name="dvt_1.rowview">
        <tr>
                        <xsl:if test="position() mod 2 = 1">
                                        <xsl:attribute name="class">ms-alternating</xsl:attribute>
            </xsl:if>
                        <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
                <td class="ms-vb" width="1%" nowrap="nowrap">
                    <span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
                </td>
            </xsl:if>
            <td class="ms-vb">
                <p>Hello, your IP Address is:</p><xsl:value-of select="$Param1"/>
            </td>
        </tr>
    </xsl:template></xsl:stylesheet></XSL>
<parameterbindings>
                    <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
                    <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
                    <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
                    <ParameterBinding Name="ListID" Location="None" DefaultValue="{1858597C-BEFE-42AF-B52A-C8A89B519F45}"/>
                    <ParameterBinding Name="Param1" Location="ServerVariable(REMOTE_ADDR)" DefaultValue=""/>
                </parameterbindings></WebPartPages:DataFormWebPart>
share|improve this answer
    
That was a little scary to put out on a production server. Did I mention that Sharepoint isn't exactly my specialty? Thanks for the quick response! –  Maclovin Jul 26 '12 at 12:24
    
@PirateEric, I see your parameter Param1, but no how it's populated. Did I missed something? –  Steve B Jul 26 '12 at 12:27
1  
This is all default code created by SharePoint Designer (2007), the only thing I did was to add a parameter through the UI for REMOTE_ADDR and replace the field I inserted into the DVWP (@Title) with the parameter ($Param1) and added in a paragraph above it. –  PirateEric Jul 26 '12 at 12:28
1  
SOme of the code didn't make it into the code block, I edited the post and its there now (at the bottom). –  PirateEric Jul 26 '12 at 12:30
    
Ok I see now :) thx –  Steve B Jul 26 '12 at 12:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.