Comparison scripts

This comparison script page shows how much scripting is required for a common task as part of a Logon Script. When not using FastTrack, logon scripts are usually made using VBScript and this page will compare typical use of these two.

In this example, we will produce the same result in VBScript and FastTrack Scripting, which is testing if the user logging on is a member of a certain group and connect a share in case the user is a member.

Note that the VBScript version is not checking for nested grouping, for instance if a user is member of a SalesEurope group which again is a member of SalesStaff. The FastTrack Script version will fully resolve all nestings, but the VBScript version would have to be expanded with recusive code to resolve all nestings to produce the exact same functionality.

Comparison scripts

VBScript version

To determine if the user is a member of a group, we will assume there is an Active Directory and use the LDAP provider, as this will require the least number of lines.
If IsMember("SalesStaff") Then MapNetworkDrive "I:","\\AcmeServer\Sales"

Function IsMember(groupName)
  Const ADS_NAME_INITTYPE_GC = 3
  Const ADS_NAME_TYPE_NT4 = 3
  Const ADS_NAME_TYPE_1779 = 1

  ''==== CONVERT GROUP NAME TO FULLY QUALIFIED NAME ====
  Set WSHNetwork = WScript.CreateObject("WScript.Network")
  Set objTrans = CreateObject("NameTranslate")
  objTrans.Init ADS_NAME_INITTYPE_GC, ""
  objTrans.Set ADS_NAME_TYPE_NT4, WSHNetwork.UserDomain & "\" & groupName
  strGroupDN = objTrans.Get(ADS_NAME_TYPE_1779)
  strGroupDN = Replace(strGroupDN, "/", "\/")

  ''==== GET GROUP AND USER ====
  Set objGroup = GetObject("LDAP://" & strGroupDN)
  Set objADSysInfo = CreateObject("ADSystemInfo")
  strUserDN = objADSysInfo.UserName

  ''==== DETERMINE MEMBERSHIP ====
  If objGroup.IsMember("LDAP://" & strUserDN) Then
    IsMember=True
  Else
    IsMember=False
  End If
End function

Function MapNetworkDrive(letter, uncPath)
  ''==== DISCONNECT EXISTING DRIVE IF CONNECTED ====
  Set objNetwork = CreateObject("WScript.Network")
  Set objDrives = objNetwork.EnumNetworkDrives()
  For objDrive = 0 To objDrives.Count - 1 Step 2
    If objDrives.Item(objDrive) = letter Then
      objNetwork.RemoveNetworkDrive letter, true
    End If
  Next

  ''==== MAP SHARE ====
  objNetwork.MapNetworkDrive letter, uncPath, false
End function

FastTrack Script version

Using a FastTrack Script the same operation requires just one line. In case of an error, the general error handler script (errorhandler.fsh) will be included and the script will continue.

If UserIsMemberOf SalesStaff Then ConnectShare I:,\\AcmeServer\Sales

Performance note

The VBScript example will be slower and will stress your Active Directory, if there are many computers in the network, as it will query your Active Directory over the network every time a user logs on. The FastTrack Script version will query only against locally cached information, which the WinLogon process has already retrieved from your domain controller.


Rating: 5 out of 5

"Use this as a replacement for VBScript and PowerShell"

"It's easy to include attractive GUI elements in FastTrack scripts, beyond the basic dialog boxes and text input that VBScript offers ... Another powerful feature is the ability to distribute scripts as Windows Installer (.msi) or standard .exe files. Although interesting in its own right, this ability results in a much more intriguing capability: to repackage -- or wrap -- software installers as .msi files without using snapshots. If you've ever created an .msi installer file from before-and-after system snapshots, for use with a software distribution system such as Group Policy or SCCM, then you know how hit-and-miss the results can be."

Read full review


Rating: 8 out of 10

"Faster than the rest"

"We found the FastTrack syntax to be more transparent and easier to learn than Microsoft's PowerShell – the editor in particular provided good support in this regard. the Script Editor offers a large number of options from the command set through to simple output of graphical elements, which cannot be achieved at all with PowerShell or other solutions or only with a significantly greater level of effort."

"Anyone wanting to tackle the many hurdles in everyday admin and especially anyone for whom logon scripts and client automation is a priority will benefit from the variety of functions offered by FastTrack."

Review in English      Review in German