Configuring Printers for Users - Citrix MetaFrame XP

Client printers don't always work in the real world, so server printers must be used.

Now that you've completed the work needed to ensure that various printers will be available to the users on your MetaFrame XP servers, you need to provide a method for users to access their printers. In some cases, as when client mapped printers are used, configuration is easy because the printers are automatically created for the users.

However, client printers don't always work in the real world, so server printers must be used. When using server printers, you need to think about how your users will these printers. Will you assign certain users to certain printers? If so, how will you do this? Maybe you want to allow all users to be able to use all printers? If this is the case, how will users know which printers they should use? We'll look at two strategies to answer these questions:

  • Assigning printers to users.
  • Methods of letting users choose their own printers.

Assigning Printers to Users

Once you decide that you would like to control which printers your users are able to print to, you need to determine how to provide that access. Setting permissions on printers is important, but permissions alone won't configure a printer for a user. For example, if you want the user "brian" to print to the \\printerserver\ fastlaser printer, you can edit the properties of that print queue and grant "brian" print permissions. However, how will Brian know how to access that printer? Is he smart enough to be able to browse the network to the \\printserver computer, and then select the fastlaser printer? Most likely, if you decide that Brian should use the \\printserver\fastlaser printer, you need a way to assign that printer to him, so that when he selects "print" from a MetaFrame XP application, the \\printserver\fastlaser printer shows up in his printer list:

There are three methods that you can use to assign server-based printers to users.

  • Use MetaFrame XP's printer configuration features.
  • Map printers in users' logon scripts.
  • Map printers as part of a user's profile and policy settings.

Method 1. Using MetaFrame XP to Configure Printers

You can use the Citrix Management Console to manage two types of printers in MetaFrame XP server farms: network printers and local printers.

  • Network Printers. MetaFrame XP gives you the ability to "import" network print servers into your server farm (CMC | Printer Management | Network Print Servers Tab | Actions Menu | Import Network Print Server). Nothing physically changes on the print servers, and there is no risk to your print servers when they are imported into the farm. (You can import print servers without their owner's permission!) Importing the print servers simply means that MetaFrame XP will take an inventory of which printers are available on the print servers that you import. This information is written to the IMA Data Store. If the printers available from an imported print server change, you can manually update the server farm's inventory (CMC | Printer Management | Network Print Servers Tab | Right-click Print Server | Update Network Print Server).
  • Local Printers. Local printers are shared printers that have print queues locally on a MetaFrame XP server. This could be a printer that is physically connected into the parallel port of a MetaFrame XP server or it could be a network printer that is installed as a local printer (usually to a "local" TCP/IP port). Records of the local printers installed on all MetaFrame XP servers in the server farm are written to the IMA data store. You can view the properties of local printers farm-wide (CMC | Printers | Printers Tab) or on an individual MetaFrame XP server (CMC | Server Properties | Printers Tab).

Both network printers and local printers require that the proper printer drivers are installed on the MetaFrame XP servers. Ideally, these drivers should be installed on all servers in the farm, because the printers are available to users on all the servers.

You can configure auto-creation settings for a local and imported network printers (Right-click on printer | Auto-creation). This allows you to choose the Windows users or groups that will automatically have the printers mapped when they log on, ensuring that only the appropriate groups or users see the appropriate printers.

Advantages of Assigning Printers with MetaFrame XP

  • Works without user profiles or logon scripts.
  • The ICA client does not need a preconfigured connection to the printer.

Disadvantages of Assigning Printers with MetaFrame XP

  • Can be time consuming to configure.

Method 2. Configuring Printers via Logon Scripts

Instead of managing server printers with MetaFrame XP, you may choose to take a more traditional route. Logon scripts have always been (and will continue to be) a simple yet effective way to map printers for specific users. (Logon scripts were covered in detail back in Chapter 5.) When it comes to printing, there are a few different ways that you can use logon scripts to map users' printers.

One of the cool things about using logon scripts to map printers is that you can incorporate conditional branching into the scripts based on a user's group membership. That way, you can give a user access to a printer simply by adding them to the appropriate Windows group. You can even set the permissions of a printer based on the same user group.

Mapping Printers with Standard Batch Files

If you want to use a regular batch file to map network printers for users, you can use the con2prt.exe command-line utility to add a printer connection for a user in a logon script. In order to use this utility, copy con2prt.exe to the %systemroot% folder on each of your MetaFrame servers. Then, call it from the logon script using the following format:

con2prt /c \\printserver\fastlaser

There are a few command-line options that you may need to use with the con2prt.exe utility.

/f - Deletes all printer connections.

/c - Connects the specified printer.

/cd - Connects the specified printer and makes it the default.

Mapping Printers with Kixtart

If you have chosen to use Kixtart as the language for your logon scripts, you can use its own native capabilities to connect to network printers. For example, the following Kixtart code checks to see whether the user is in the "PrinterGroupName" Windows group. If he is, it adds the \\printserver \fastlaser printer connection and sets it to be the default printer for the user. Many Citrix administrators use code like this, adding this code segment for each printer in the environment. Their final logon scripts may have dozens of printers.

if ingroup("PrinterGroupName")
   addprinterconnection ("\\printserver\fastlaser")
   setdefaultprinter ("\\printserver\fastlaser")

Advantages of Assigning Printers with Logon Scripts

  • You can assign printers on a per-user basis, or per-group basis.
  • You can assign different printers for different servers.
  • Logon scripts can be used in many different ways.

Disadvantages of Assigning Printers with Logon Scripts

  • Requires knowledge of the logon script language.

Method 3. Configuring Printers via User Profiles

The third option for assigning printers to users is to use their user profiles. Full details of profile usage are available in Chapter 5. Srofile allow users to map printers and set defaults which can then become a permanent part of their profile.

Letting Users Choose Their Own Printers

Instead of assigning printers to your users, you may have an environment in which users need to be able to choose their own printers. This makes your job much easier. If security is important, you can still set the printing permissions on the printers that you don't want everyone to be able to print to.

If you simply give a user permissions to print to a network printer, that printer will not be automatically set up for the user. However, the user will be able to browse the network and connect to the printer if he needs to print to it.

Advantages of Letting Users Choose Their Own Printers

  • You can still set security for printers that need limited access.
  • There is less for you to configure.

Disadvantages of Letting Users Choose Their Own Printers

  • Users need to know how to connect to printers.
  • Users need to know which printer they are looking for.

Users are able to configure their own printers via Windows Explorer, or the "Printers" folder in the Start Menu. However, in the real world, many people choose not to allow users to connect to the Windows desktop or Windows Explorer, and thus users are not able connect to network printers. To prevent this, make the "Printers" folder a published application, allowing users to connect and configure the printers saved in their user profiles. If your profiles are configured properly, any changes that a user makes in the "Printers" published application are available from within any published application that they run.

Publishing the Printers Folder as Published Application

Publishing the Printers folder is not intuitive at all, although it is very easy to do. The Printers folder does not have its own executable; it's actually built into the Windows shell (explorer.exe). These types of Explorer shell components are called "shell extensions." Each shell extension has its own GUID, which is like a serial number that differentiates it from all other shell extensions. Information about different shell extensions are contained in the following registry location: HKEY_CLASSES_ROOT\CLSID\<unique guid>.

In this case, the Printer folder's unique GUID is {2227A280-3AEA-1069-A2DE-08002B30309D}.

Any Windows program can access a shell extension by calling explorer.exe and requesting the GUID of the extension it wants. You can create a MetaFrame XP published application that points to the Printers shell extension.

Here's a neat trick to show how that shell extension will work: create a new folder on your Windows desktop; name the folder "Printers.{2227A280-3AEA-1069-A2DE-08002B30309D}" with no spaces anywhere in the name; press Enter, the icon for the folder will change into the Printers folder icon; and when you open that folder it will look just like the Printers folder from the start menu. To make the Printers folder available as a published application, you need to publish a folder like this. Here are the steps to take:

  • Create a folder called "Printers.{2227A280-3AEA-1069-A2DE-08002B30309D}." Make sure that there are no spaces in the name anywhere.
  • Put that folder somewhere it can be published. For example, use the m:\print\ directory, so that the full path of our folder is m:\ print\Printers.{2227A280-3AEA-1069-A2DE-08002B30309D}\.
  • Now, all you need to do is publish that folder. To publish a folder in MetaFrame XP, you need publish explorer.exe with command line switches that will open that folder. However, you need to first make a copy of explorer.exe. Your copy can be called anything except explorer.exe. This will force your published application to open a new instance of explorer.exe, since yours will have a different name than the background copy that is already running.
  • Put the new copy of explorer.exe (Let's call it printexplorer.exe) into the m:\print\ folder.
  • Publish this application. The command line to publish will be the following: m:\print\printexplorer.exe /n,/root, m:\print\Printers.{2227A280-3AEA-1069-A2DE-08002B30309D}.

Let's take a closer look at the command line that you are publishing. It begins by launching printexplorer.exe with several command line options. The /n option tells explorer to open a single-paned window. The /root option tells explorer to open this window as the root, preventing users from being able to click the "Up" folder to browse back up through the directory structure. The command ends with the full path to your custom folder, telling explorer which folder should be used as the root.


Start the conversation

Send me notifications when other members comment.

Please create a username to comment.