Kaseya Community

Stolen laptop - Script to report public IP?

This question is not answered

Is there a WMI script, or any way I can use Kaseya to report the public IP to the Kaseya Server (using Get File or whatever) on agent check in?

This way if a tablet PC or laptop gets stolen I can give the public IP information to the police or what not.




All Replies
  • Check on your Role(s), i'm sure that on a role you are the documents section is unchecked.

  • here's a VBscript that will send you an email with the stolen ip info. You'll need to create a gmail account to relay it off of (that's what I did anyway). I still use the alerts in Kaseya and use this along with for extra info. hope this helps as well. 


    'On Error Resume Next
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    sComputerName = WshNetwork.ComputerName
    const URL = "http://xml.showmyip.com/"
    set xmldoc = CreateObject("Microsoft.XMLDOM")
    for each x in xmldoc.documentElement.childNodes
    if x.NodeName = "ip" then
    myip = x.text
    end if
    if x.NodeName = "host" then
    myhost = x.text
    end if
    if x.NodeName = "timestamp" then
    mytime = x.text
    end if
    myinfo = myip & vbCRLF _
    & "Host: " & myhost _
    & vbCRLF & "Time: " & mytime
    xSubject = "Stolen PC Alert for  " & sComputerName
    xBody = "The computer " & sComputerName & " checked in from the following IP: " & myinfo
    SendMail xSubject, xBody
    Function SendMail(sSubject, sBody)
    Set objEmail = CreateObject("CDO.Message")
    objEmail.From = "Stolen@yourdomain here.com"
    objEmail.To = "where it's going"
    objEmail.Subject = sSubject
    objEmail.Textbody = sBody
    'objEmail.Importance = CdoHigh
    objEmail.Configuration.Fields.Item _
        ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    objEmail.Configuration.Fields.Item _
        ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
    objEmail.Configuration.Fields.Item _
    	("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    objEmail.Configuration.Fields.Item _
    	("http://schemas.microsoft.com/cdo/configuration/sendusername") = "put your email address here"
    objEmail.Configuration.Fields.Item _
    	("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
    	objEmail.Configuration.Fields.Item _
    	("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    objEmail.Configuration.Fields.Item _
        ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
    End Function

  • when a machine checks in the Gateway IP it reports is normally its WAN IP.

    This is listed under machine details. Is that not sufficient?

  • Mmartin - in most cases I'd say yes, but i'm lazy and I wrote the vbscript as a way to teach myself how to write vbscript. :D

    I just thought I'd add it in the forum for anyone who might like it.

    in most cases our customers don't want their comptuers back, (insurance has already replaced them). They usually just ask us to wipe the drives if they check back in. we try to encrypt the drives when we can too which also helps.

  • you can also just stick this into a kaseya script if you use the GET URL it will paste it to a txt file and away you go saves messing with VB


  • something else that might be useful is PREY http://preyproject.com/  

    I use it on my wife's PC and a few family members and I've found my brothers laptop (it wasn't stolen, just misplaced :D)  

    works really well too.