Solved

Logoff script

Posted on 2009-07-02
23
996 Views
Last Modified: 2013-11-10
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.
0
Comment
Question by:RFEMHelpdesk
  • 8
  • 5
  • 5
  • +1
23 Comments
 
LVL 5

Expert Comment

by:artoaperjan
Comment Utility
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
 
LVL 5

Expert Comment

by:artoaperjan
Comment Utility
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
 

Author Comment

by:RFEMHelpdesk
Comment Utility
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
 
LVL 40

Expert Comment

by:RQuadling
Comment Utility
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
 

Author Comment

by:RFEMHelpdesk
Comment Utility
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
 
LVL 40

Expert Comment

by:RQuadling
Comment Utility
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
 

Author Comment

by:RFEMHelpdesk
Comment Utility
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
 
LVL 40

Expert Comment

by:RQuadling
Comment Utility
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
 
LVL 40

Expert Comment

by:RQuadling
Comment Utility
I think you need to think of a different way of handling this.
0
 

Author Comment

by:RFEMHelpdesk
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 40

Expert Comment

by:RQuadling
Comment Utility
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
 
LVL 6

Expert Comment

by:ou_dober
Comment Utility
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
 

Author Comment

by:RFEMHelpdesk
Comment Utility
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
 
LVL 6

Expert Comment

by:ou_dober
Comment Utility
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
 

Author Comment

by:RFEMHelpdesk
Comment Utility
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
 
LVL 6

Accepted Solution

by:
ou_dober earned 500 total points
Comment Utility
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
 

Author Comment

by:RFEMHelpdesk
Comment Utility
Unfortunately this did not help. Shut down continues be fore I can even get a username typed in. (About 10 seconds)
0
 

Author Comment

by:RFEMHelpdesk
Comment Utility
Correction 5 seconds
0
 
LVL 6

Expert Comment

by:ou_dober
Comment Utility
My mistake

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

Set wscript.sleep to 420000

1000 = 1 sec
0
 
LVL 6

Expert Comment

by:ou_dober
Comment Utility
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is an article about Leadership and accepting and adapting to new challenges. It focuses mostly on upgrading to Windows 10.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
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.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

763 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

6 Experts available now in Live!

Get 1:1 Help Now