Lead Image © Andrey KOTKO, 123RF.com

Lead Image © Andrey KOTKO, 123RF.com

Comparing Logon Script Alternatives

Scripting Competition

Article from ADMIN 26/2015
By
We compare the performance of batch, VBScript, and PowerShell commands with four standard tasks.

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.

...
Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs



Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>
	</a>

<hr>		    
			</div>
		    		</div>

		<div class=