I Need To Make A Change With My IT Support! Call (225) 706-8414

Installing Printers Using a Windows Logon Script

You have an Active Directory network and want to install printers using a logon script.

Solution

This is done using  the logon script, a VBS script, and, optionally, IFMEMBER.

  1. Log into your DC.
  2. Verify via ADUC that every user has a logon script.
  3. Open %LOGONSEVER%NETLOGON in Windows Explorer.
  4. Create the file configure_printers.vbs. An example is given near the end of this article.
  5. Edit the logon script.
  6. Add the following line to the end:
    rem Automatically add our printers.
    cscript %LOGONSERVER%netlogonconfigure_printers.vbs

Our example configure_printers.vbs script has the following:

Dim net
Set net = CreateObject(“WScript.Network”)
net.AddWindowsPrinterConnection “\util-2print-brother-1”
net.AddWindowsPrinterConnection “\util-2print-hpphoto-1”

‘ Set the default printer now
net.SetDefaultPrinter “\util-2print-hpphoto-1”

This works great to set the same printers for all users, including every user having the same default printer.

But what if you don’t want every user to have access to every printer? Or different users should have different printers? In that case, you need to use IFMEMBER (part of the Windows 2003 Resource Kit).

So by using IFMEMBER, we may have:

IFMEMBER accounting_group
IF NOT ERRORLEVEL 1 GOTO :not_accounting_group
cscript configure_accounting_group_printers.vbs
:not_accounting_group 

IFMEMBER sales_group
IF NOT ERRORLEVEL 1 GOTO :not_sales_group
cscript configure_accounting_group_sales.vbs
:not_sales_group

Notice how we have a different VBS file for each AD group?
Be sure that all users have permissions to the printers being added. Should there be denied permissions to a printer for a user, the VBS script will stop running immediately when applied. So should a printer with denied permissions be the first to be added, no printers will be added until the script is edited

Concerned About Cyber Attacks?

CLICK HERE >

Want to Migrate to the Cloud?

CLICK HERE >
Office 365

Ready to Experience Microsoft Office 365?

Want the latest IT news directly in your inbox? Subscribe now!