
Lead Image © Andrey KOTKO, 123RF.com
Comparing Logon Script Alternatives
Scripting Competition
Logon scripts provide an important service when setting up a PC workstation: They create an individual workplace environment for each employee based on the employee's logon context. On Windows XP, scripting was limited to batch files and VBScripts; however, PowerShell has elevated the scripting game since Windows 7.
Is PowerShell really so much better, though? To try and find some clarity in this matter, I put the three technologies – batch (statements and binaries interpreted by cmd.exe
), VBScript (Visual Basic Script Edition, processed by Wscript.exe
or cscript.exe
), and PowerShell (version 3; console with additional script engine for PS1 files) – to the test. In doing so, I consider:
- How powerful is each technology?
- What are the limitations and restrictions?
- How intuitive is each technology, and how well is it documented?
Objective and Scenario
Logon script targets can be divided roughly into two areas: infrastructure and local system. Infrastructural objectives could be managing shares, particularly mapping network drives, or connecting a network printer and setting the default printer. For local systems, it might be necessary to run programs, change a registry key, or create a link.
The typical tasks I will give the three Microsoft scripting engines in this test involve mapping shares, adding a network printer, running a file, and changing the registry. Additionally, I expect to see output in the event of an error.
Mapping Shares
Connecting to shares on a server is a standard task in setting up a desktop. The DOCS share on server SRV will be mapped as drive M . To simplify matters, I am omitting the transfer of user information for securing rights for this action.
...
Buy this article as PDF
(incl. VAT)