Today I got a request from one of my customers to display the IP address of the client computer on the SharePoint intranet. Well I started of like any it-consultant searching the big internet for a web-part or some nice code to copy with pride. Well it didn’t happen this time. I grabbed a cup of coffee and out of the blue came the solution as easy as one two three.
First I created a Web Site on port 86 on the front end SP server. Created a new folder for the Pysical inetpub\wwwroot\86 (any free port in 8x is ok)
Set the default document to Default.asp
Create a deafult.asp file with the following asp code (well you can replace the norwegian sentence “Din IP adresse er” with Your IP Address :
<html>
<body>
<p>
<b>Din IP addresse er:</b>
<%Response.Write(Request.ServerVariables("remote_addr"))%>
</p>
</body>
</html>
Test it from a remote server (this will most likely run without IISreset)
To display this nicely inside SharePoint, just add the PageViewer web-part, Chrome type it to None, trim the Height and With to your satisfaction. And voila!! You are all done.