WARNING: This post is outdated, and it has been for many years. I very strongly discourage you from using this for any purpose whatsoever. I’m aware that this is still in use in some environments, and works, but there are others ways of accomplishing the same thing that are generally faster and far less error-prone.

Years ago (Windows XP era?), I wrote a “standard” login script for my employer. Features:

  • Maps network drives, based on group membership (one ADDS group = 1 or more drive letters)
  • Adds printers, based on group membership
  • Migrates printer queues (remove queue from one server, add queue from another server) or removes queues, whenever the queue is found (not group based)
  • Launches applications, based on group membership
  • Writes a log of what occurred during the login script execution, both to the windows event log and to a text file
This isn’t the ultimate login script… there is a lot to be desired… but it mostly works.

Known problems:

  • Will throw an error and fail to do anything at all if WMI is broken
  • May throw an error or hang if group membership requires a network drive be assigned to the same drive letter as a current physical drive
  • All users being assigned to this script must be a member of at least 2 ADDS groups other than their primary (POSIX) group (so, three groups total). This is because I’m not properly handling the group membership return array, and I’m too lazy to fix it right at the moment.
  • May hang if group membership requires installation of a print queue that does not exist
In order to use this, place all of these files in NETLOGON:

group_applications.tab group_drivemappings.tab group_printers.tab printer_migrations.tab standard.vbs

You’ll need to review each of the files, to customize them for your environment. Standard.vbs does the work, and just references the other files. “my.full.domain.name” means the FQDN of your domain, not a server or domain controller. “MYNETBIOSDOMAINNAME” means the NETBIOS short name of your domain. Unfortunately, I didn’t take the time to comment the script very well… feel free to email me if you have any questions (andrew@ the domain this page is served by). Please also let me know of any changes you make to this login script, or just if you’re using it. Share the wealth. :)