Databases
Sub Sections
Other Sections
Databases
Sub Sections
Other Sections
The logon GUI is a VB.net application designed to run shell scripts or programs and display their progress in a GUI. Initially I just planned to update my old HTA Logon scripts but soon discovered that a Logon GUI would look more professional and provide the end user with just enough information to be informed if the logon process was a success. See Ticket #66.
The Logon GUI is added as a users logon script, either by using Group Policy or the Logon Script within the Users Profile Tab the script will run when a user logs on. The GUI will load before the desktop and call each of the four pre-designated scripts simultaneously. As each script runs and when they provide feedback, the GUI will update the progress bars accordingly.
The Logon GUI will as a minimum, run for seven seconds. there is a two second pause before script processing starts and a further five second pause after all scripts complete.
The progress bars are an indication of how far each stage of the logon process has come; generally the bar will be blue. The following table denotes the colours available.
Script Code | Colour | Explaination |
---|---|---|
0 | Blue | Normal |
1 | Red | Error |
2 | Orange | Warning |
3 | Light Gray | No Script Found |
Any command line script that outputs to the command line will work with this GUI1). The scripts are stored in the same path as the LogonGUI executable.
The following script names can be used for the Logon GUI2).
The script that runs must output a correctly formatted string. This string provides information to update the GUI accordingly and without a valid output string the GUI may freeze or crash.
Example Script output for the Logon GUI:
5-,-32-,-0-,-Finished mapping G Drive
Output Key
Example | 5 | -,- | 25 | -,- | 0 | -,- | StartedLogon | |
Key | Total Commands | Seperator | Progress Level | Seperator | Error | Seperator | Message | |
---|---|---|---|---|---|---|---|---|
Variable Type | Integer | -,- | Integer (< = 100) | -,- | Integer | -,- | String |
This is the total commands that the script is going to run and is hard coded into the script.
The progress bar is incremented upto a max value of 100. This value will increase each time a command runs and is stepped up to a value of 100/TotalCommands.
Not yet implemented
This value is an integer, if this value changes to anything other than 0 the highest number will remain and so to will the colour of the progress bar. so if the script returns a 2, the progress bar will remain the same colour as warning.
The message that is placed here is what will be added to the log file. The logfile is saved to %USERPROFILE%\LogonGUI-{SCRIPTNAME}.log and gets over written every time the user logos on.
Operating System: (Tested) | Windows 7 |
Windows Server 2008 | |
Domain Client: | Netlogon Share on Domain Controller |
Standalone Client: | Netlogon Share on the local machine |
Hard Drive Space: | |
LogonGUI: | 150kb |
Scripts: | as Large as they are |
.NET 2.0 Runtime Installed | |
good understanding of scripting |
Normal Operation: The progress bars look like this under normal operation. Once the applicable script is found it will step the progress bar to 3% before it commences to increment the progress bar.
No Script Found: progress bar will still complete but they will be gray in colour.
Warning Demo: progress bar will change to orange.
This application is not freely availible and if you would like to utilise this application, for a small fee I may be able to provide it to you. Please use the contact us form at nofusscomputing.com.
The scipt below has only been saved as a record of history. please use the new script template.
This file will download with a .txt file extension. Please rename the file so it has the right extension as per the mentioned filename.
'************************************************************************ ' No Fuss Computing ' LogonGUI VBScript Template ' ' Created By: Jon @ No Fuss Computing ' Created on 07 Jun 2014 ' Filename: LogonGUI-Template.vbs '************************************************************************ Set objShell = Wscript.CreateObject("Wscript.Shell") Set objNetwork = CreateObject("Wscript.Network") Dim iProgressStep, iTotalMappings, iIncrement ' Default Integers Dont Modify! iIncrement = 1 'SOF *******************Custom Variables********************************** strUserName = ucase((objNetwork.UserName)) 'EOF ********************************************************************* ' Set Logon GUI Variables iTotalMappings = 10 ' Change this as required iProgressStep = 100 / iTotalMappings ' Don't Change!! call main() ' Launch Script Sub Main() ' Insert your code in here. ' Don't forget to use progress out after each command so the progress bar increments and the GUI doesn't Freeze!!. End Sub ' EOF Sub Main ' ' *************************************** Functions ******************************************** ' Function ProgressOut(sMessage) ' This is a default Function Don't remove!! Wscript.Echo(iTotalMappings & "-,-" & (iIncrement * iProgressStep) & "-,-" & sMessage) iIncrement = iIncrement + 1 End Function ' '********************** Your Custom Functions Below this Line ********************************** '