Logoff script

Our firm would like to have a Webpage open and pre-populate to enter Time and Labor data prior to the machine being shut down. Proposed sequencing
1. Select Logoff
2. A Web page launches
3. Script populates a static field and a usename field (based on logged on user)
4. Users enters data in Time and Labor application
5. Internet window is closed
6. Logoff process initiates.

Is this possible? If not any suggestions on how to manage the Time and Labor application would be greatly appreciated.
RFEMHelpdeskAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

artoaperjanCommented:
hi i would sugest to have silent log on and log of script which will send pc name, user and time

u can send it to txt file or directly to SQL or both which means all your pc will be sending info as txt to your server then your server will read it to SQL  

see which one you like more then come back i'll help
0
artoaperjanCommented:
Here you go

You can use this script for log on and for log of.
As I have said just decide how what you want then I can help you to do the rest.

Bellow attached script is in txt extension you need to change it to VBS extension than when you run it a text file will be created on your C drive with all info in it the separator is -

Regards    

LogonScript.txt
0
RFEMHelpdeskAuthor Commented:
What you have suggested is a great method however, our Time and Labor data must be entered in the Paychex  web portal (https://timeandlabor.paychex.com/secure/login.asp?).
I have a logon script that loads this page and is is working great. What I really need is to be able to force that web page to come up when someone tries to logoff or shutdown. Then when that page is closed logoff and shut down continues.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Richard QuadlingSenior Software DeveloperCommented:
You can use an onUnload event handler to create a new window (popup). But this technique is often blocked as it is a popup.

Doing it on page is fine until the browser is closed.

One option is to email the operator with a link to a page to capture the data once they logoff.
0
RFEMHelpdeskAuthor Commented:
Can you elaborate.? Will this allow for the logging in to the Paychex portal entering of data and shutdown to begin once the window is closed?
0
Richard QuadlingSenior Software DeveloperCommented:
I would just have a separate page which allows the Paychex processing. If you want to incorporate that into the onUnload event, fine, but make sure you tell the users about popups and that your site should be allowed to perform the popup.
0
RFEMHelpdeskAuthor Commented:
Would you be able to provide an example or a code snippet defining your suggestion and how it would be implemented in a logoff script please.
0
Richard QuadlingSenior Software DeveloperCommented:
Guess what. I just realised you meant logoff on the machine.

As far as I know, the logoff process inhibits the launching of new processes.

You would have to have the process running all the time and handle what happens when the program is told to close.

The program would need to run hidden and have access to whatever resources it needed all the time.
0
Richard QuadlingSenior Software DeveloperCommented:
I think you need to think of a different way of handling this.
0
RFEMHelpdeskAuthor Commented:
That is what I am trying to figure out. I am really looking for the options which can then be developed into the solution.
0
Richard QuadlingSenior Software DeveloperCommented:
Then the only way I know is to have a small service app run all the time. When the app is told to close it asks for the additional details and saves them (maybe injecting them into a DB?). Once logged, the program can quit.

Using something like the windows resource tool kit will allow you to run any program as a service. You just need to track the close/exit event.
0
ou_doberCommented:
RFEMHelpDesk

Based on the following statement you made on 07/03/09 09:57 PM, ID: 24775511:
What you have suggested is a great method however, our Time and Labor data must be entered in the Paychex  web portal (https://timeandlabor.paychex.com/secure/login.asp?).I have a logon script that loads this page and is is working great. What I really need is to be able to force that web page to come up when someone tries to logoff or shutdown. Then when that page is closed logoff and shut down continues.

I would like to suggest creating a GPO and adding the script to  the User Configuration portion to have the users post there time.

Instructions
  • Create a new GPO called "PostingTime" in a test OU with a test user account.
  • Go to User Configuration > Windows Settings > Scripts > Logoff
  • Insert the login script you have already built (optionally this can be applied to the Logon as well)
  • Apply changes to GPO and exit.
  • Login to test machine with user account
  • If no result, go to a command prompt and type gpupdate to refresh the machine with the new GPO.
  • Type gpresult and check to ensure that the new GPO has applied
  • Log off of the machine and back in and see you results
If you are not the Active Directory administrator, you might need to get with them for further assistance with this.

By doing this also it allows for better central administration of the scripts as well.

Here is some more info about GPO's.

http://technet.microsoft.com/en-us/library/cc782678%28WS.10%29.aspx

http://technet.microsoft.com/en-us/library/cc787823%28WS.10%29.aspx

http://technet.microsoft.com/en-us/library/cc782980%28WS.10%29.aspx

ou_dober



0
RFEMHelpdeskAuthor Commented:
Thank you ou_dober

I am able to get the Internet Explorer page to come up on logout now :)
However, It does not give enough time to login to the website and enter required data and logout prior to the Windows shutdown completing. Is there a way to pause the logoff/shutdown process until the Internet window is closed or for a specified amount of time (5-7 min)?
0
ou_doberCommented:
Can you post your script so that I can see what it is doing?  My first guess would be that you need a timeout string added in the vbscript to allow for enough time to run the browser.
0
RFEMHelpdeskAuthor Commented:
This is what I have put in the testing script.
        Set WshNetwork = CreateObject("WScript.Network")
	    Set oIE = WScript.CreateObject("InternetExplorer.Application") 
	    oIE.Visible = True 
	    oIE.Navigate("https://timeandlabor.paychex.com/secure/login.asp)

Open in new window

0
ou_doberCommented:
Try this.
Set WshNetwork = CreateObject("WScript.Network")
Set oIE = WScript.CreateObject("InternetExplorer.Application")
oIE.Visible = True
oIE.Navigate("https://timeandlabor.paychex.com/secure/login.asp)
' Change 60 to seconds needed
WScript.sleep 60
WScript.Quit

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RFEMHelpdeskAuthor Commented:
Unfortunately this did not help. Shut down continues be fore I can even get a username typed in. (About 10 seconds)
0
RFEMHelpdeskAuthor Commented:
Correction 5 seconds
0
ou_doberCommented:
My mistake

http://www.ss64.com/wsh/sleep.html

Set wscript.sleep to 420000

1000 = 1 sec
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.