Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Windows Logoff Script

Posted on 2009-05-11
5
Medium Priority
?
495 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Google Certified Professional - Cloud Architect

This course (1 of 3) is designed to help students who are interested in Google Cloud Platform (GCP) to become familiar with the platform, navigate the console and learn its capabilities. It will also prepare students for the Google Cloud Architect certification exam.

Question has a verified solution.

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

In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

721 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