Solved

Windows Logoff Script

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

820 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