Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Windows Logoff Script

Posted on 2009-05-11
5
Medium Priority
?
497 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 2000 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Windows 10 Creator Update has just been released and I have it working very well on my laptop. Read below for issues, fixes and ideas.
This article is about my experience upgrading my consulting machine to Windows 10 Version 1709 (The Fall 2017 Creator Update)
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

971 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