Solved

Windows Logoff Script

Posted on 2009-05-11
5
490 Views
Last Modified: 2012-06-27
I'm not sure if this will make complete sense right off - but I'll try.,

I need to come up with a script to run at logoff that will essentially tell an external website to run a script or something that will send XML via http-post to another server.

so...

Windows Logoff > script runs telling > www.website.com/xml_script.whatever to send > XML via http-post to an IP address

I'd love some help/direction on this, so please ask any clarifying questions you may need.

I DO already have code of the website that currently sends the XML code to the server (IP address) in question when activated from within the website (form) - I'm just not certain how to do so from a script at windows logoff.
0
Comment
Question by:prototypeit
  • 3
  • 2
5 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 24356309
Hi, prototypeit.  

I assume the website page that sends the XML code to the server is using ASP or PHP.  If so, then your logoff script just needs to cause that page to run.  Here's one way to do that.


Dim objXMLHTTP, varResult
Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")
'Change the URL on the next line'
varResult = objXMLHTTP.open( "POST", "http://mypage.company.com", false )
varResult = objXMLHTTP.send()
strResponse = objXMLHTTP.responseText
Set objXMLHTTP = Nothing

Open in new window

0
 

Author Comment

by:prototypeit
ID: 24356348
BlueDevilFan -

Thank you so much - I believe that almost puts me where I need to be!

One question - I have a variable I need to pass as well.

The variable, MAC_Addr, is static in the .vbs script, but... variable (of course) on the website (PHP).  How can I pass that information along?
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 24356923
You can pass variables in te URL just as you can with a website URL.  Change line 4 to something like what I've shown in the snippet where somename is the name of a querystring variable and strMAC is a variable with the MAC address.  At the PHP end you'll need to retrieve the variable.  Sorry, I don't know PHP so I can't give you the command required.  In ASP it would be

    strMAC = Request.Querystring("Variable Name")
varResult = objXMLHTTP.open( "POST", "http://company.com/mypage.php?somename=" & strMAC, false )

Open in new window

0
 

Author Closing Comment

by:prototypeit
ID: 31580118
Sorry for the delay - but THANK YOU - your answer led me just where I needed to go!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 24400087
You're welcome.  Glad I could help.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question