HI All,
I am new to VB script. i want to log users IP addresses who accessing my system. is it possible to do in VB Script.
Thanks,
Prabhu Selvakumar
Printable View
HI All,
I am new to VB script. i want to log users IP addresses who accessing my system. is it possible to do in VB Script.
Thanks,
Prabhu Selvakumar
Yes - Request.ServerVariables("REMOTE_ADDR") will contain the user's IP address. Then you can write it to a text file, insert it to database, etc.
Thanks SambaNeko, could you please share the script.... i have tried lot but i could not find it... please help me on this...
i have tried below script to print the remote IP who accessing my system
On Error Resume Next
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Do while(true)
wscript.echo "******** " & Request.ServerVariables("REMOTE_ADDR")
Loop
the above code is not working... could you please help me on this.
Ah, you're actually asking something different than what I thought you were. Not sure how to get the IP in your scenario. Is this of any use? The relevant part:
That may only be getting the IP of your own system though... I'm really not sure.Code:'Get IP address of the computer and display it in the window
Set IPConfigSet = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
objdocument.WriteLn "IP Address: " & IPConfig.IPAddress(i) & "<br>"
Next
End If
Next
Thanks for your reply SambaNeko, i hope the above code will print my system IP address.