Solved

Windows Logoff Script

Posted on 2009-05-11
5
488 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

The problems with reply email signatures

Do you wish that you could place an email signature under a reply? Well, unfortunately, you can't. That great Exchange/Office 365 signature you've created will just appear at the bottom of an email chain. What a pain! Is there really no way to solve this? Well, there might be...

Join & Write a Comment

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now