Information Technology Reference
In-Depth Information
Make sure that you use credentials that have rights to execute the scripts on the local or
remote systems. Without these, the commands will fail.
8-12. Mapping Printers Using Group Policy
Problem
You want to use Group Policy to map network printers on workstations.
Solution
This problem does not have a straightforward solution using a graphical user interface, the
command-line interface, or VBScript. This problem is somewhat unique in that regard. The
solution requires knowledge of Group Policy configuration and is combined with a logon script
that uses the rundll32 printui.dll PrintUIEntry syntax (used in previous recipes in this chapter).
1.
Open Active Directory Users and Computers and navigate to the organizational unit
(OU) that contains the computers to which this policy will apply. (If your computers
still reside in the default Computers container, you should create a new OU and move
the computers there.)
2.
Right-click the OU and select Properties.
3.
Select the Group Policy tab.
4.
Open the Group Policy Editor. Create and link a Group Policy object to the desired OU.
You can call it Map Printers or any other meaningful name.
5.
Verify that the computers have permissions to both read and apply the Group Policy.
You may want to use the Domain Computers security group, or you can use a group that
you have created.
6.
Right-click the policy and select the option to edit the policy.
7.
Navigate in the left pane to Computer Configuration
Windows Settings
Scripts
(Startup/Shutdown).
8.
In the right pane, double-click Startup.
9.
Click the Show Files button to open the scripts folder in Windows Explorer.
10.
Create a text file in the scripts folder. Name it MapPrinters.bat, or use any other convenient
filename as long as its file extension is .bat.
11.
Edit the MapPrinters.bat logon script in Notepad.
12.
Put the following code into the script file. Save it when complete and close the Windows
Explorer window.
> rundll32 printui.dll,PrintUIEntry /ga /n \\ <PrintServerName>
\ <PrinterShareName> /j "LanMan Print Services"
Search WWH ::




Custom Search