Article
This document outlines an example of how to record workstation login times with SecureLogin.
You can't improve workstation login times without measuring how long they are taking. So if you have users complaining about long login times or if you are working on a project to reduce login times the first thing you need to find is a way of measuring and recording how long the logins are taking. This doc is one possible solution.
SecureLogin is typically used to allow enterprise single sign at the workstation level. But the flexibility of the application and the scripting language it invokes makes it a good tool to accomplish other desktop centric tasks. The process outlined in this doc is an example of this.
If a user is running SecureLogin in eDirectory mode you can access attributes from the eDirectory user objects in a SecureLogin script by referencing the attribute with a % in front of it.
So in a SecureLogin script you can reference the logintime attribute in by referencing %logintime.
You can utilize this info by comparing it against the time when SecureLogin finishes loading by adding a script like the one below to the users startup script.
# Get the eDirectory login time Set "?logintime" "%login time" #get the time when SecureLogin starts Set "?now" "?CurrTime" #Change these times to readable formate ConvertTime "?logintime" "?flogintime" ConvertTime "?now" "?fnow" #Subtract time Now from the stored in eDirectory Subtract "?now" "?logintime" "?total" #Write this info out to file c:\temp\logintime.txt GetReg "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Hostname" "?hostname" Run "C:\windows\system32\cmd.exe" /c echo Hostname - "?hostname" \n "test" >>c:\temp\logintime.txt Run "C:\windows\system32\cmd.exe" /c echo Login start Time - "?flogintime" >>c:\temp\logintime.txt Run "C:\windows\system32\cmd.exe" /c echo Login complete time "?fnow" >>c:\temp\logintime.txt Run "C:\windows\system32\cmd.exe" /c echo Total Login time (secs) - "?total" >>c:\temp\logintime.txt Run "C:\windows\system32\cmd.exe" /c echo **************************** >>c:\temp\logintime.txt
Having this script run as a SecureLogin startup script will result in info like the sample getting written to the file c:\temp\logintime.txt
************
Hostname - Workstation123
Login start Time - "Fri Sep 03 14:41:59 2010"
Login complete time "Fri Sep 03 14:42:30 2010"
Total Login time (secs) - 31
************
Keep in mind the following if using this method.
-If you are running in cache mode and reference a % variable it will get an error because the attribute is not available. So you may need to include a check that the user is logged in prior to getting % variables.
-This example only works in eDirectory mode, the % variable may be different if running in AD/LDAP mode.
-The user who is logging into this workstation needs rights to write to the logintime.txt file.
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.
Related Articles
User Comments
- Be the first to comment! To leave a comment you need to Login or Register
- 2712 reads


0