0

How can I know what the actual IPs of who open the site or hit on server from IIS Logs or Windows Firewall Logs or other way?

Windows Version : Windows Server 2008 R2 DataCenter
IIS Version : 7.5

Cœur
  • 37,241
  • 25
  • 195
  • 267
Alharith Aqra'
  • 99
  • 1
  • 2
  • 6
  • Try if a slight different version of linux command could be used: `awk '{print $1}' PATH_TO_THE_ACCESS_LOG|sort -u` ? Also check for solution here http://dba.stackexchange.com/questions/1613/iis-access-log-to-sql-normalization – sitilge Feb 04 '15 at 09:05
  • Do you want to do it from you [code behind](http://stackoverflow.com/questions/735350/how-to-get-a-users-client-ip-address-in-asp-net) or do you want to look for [log files](http://stackoverflow.com/questions/6426375/where-can-i-find-the-iis-logs)? – शेखर Feb 04 '15 at 09:10
  • Șhȇkhaṝ log is not saving the actual ip saving always 10.1.1.1 – Alharith Aqra' Feb 04 '15 at 10:51

1 Answers1

0

its simple you can use this function to find the ip of the client

string ipaddress;
        ipaddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (ipaddress == "" || ipaddress == null)
            ipaddress = Request.ServerVariables["REMOTE_ADDR"];

hope it will help you bye

dazzling kumar
  • 584
  • 1
  • 8
  • 17