Solved

Logoff script

Posted on 2009-07-02
23
1,000 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
[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
  • 8
  • 5
  • 5
  • +1
23 Comments
 
LVL 5

Expert Comment

by:artoaperjan
ID: 24767948
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
ID: 24773969
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
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.
0
Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

 
LVL 40

Expert Comment

by:Richard Quadling
ID: 24788966
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
ID: 24789093
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:Richard Quadling
ID: 24792546
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
ID: 24793241
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:Richard Quadling
ID: 24793265
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:Richard Quadling
ID: 24793273
I think you need to think of a different way of handling this.
0
 

Author Comment

by:RFEMHelpdesk
ID: 24793281
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
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 24793539
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
ID: 24805878
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
ID: 24806329
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
ID: 24806358
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
ID: 24806384
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
ID: 24806461
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
ID: 24807315
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
ID: 24807325
Correction 5 seconds
0
 
LVL 6

Expert Comment

by:ou_dober
ID: 24807358
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
ID: 24807374
0

Featured Post

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Server 2012 Start Menu 6 48
JVM error from eclipse 1 26
SCOM - Service Restart 1 29
Windows 10 14 36
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
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…

734 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