Group Policy Central

Posts tagged ‘Printer’

Group Policy FAQ #2: How do you map a printer using Group Policy Preferences?

In this second of what I am sure are many FAQ posts, I am going to show you how you can use Group Policy Preferences to map printers in your organisation to help you do away with mapping printers via logon scrips.

Firstly this is only a brief introduction to printer mappings. If you want a more advanced tutorial on using Printer Preference then I recommend you take a look at my other post How to use Group Policy Preferences to dynamically map printers with Roaming Profiles.

Firstly you will need to check that you have already have got the Group Policy Preference Prerequisites installed and you also have the Group policy Management Console Installed on a management computer in your environment.

Now to map the printers all you need to do is go to the Printer Extension option of the Group Policy you want to apply the setting from (see below).

image

All you need to do now is put the UNC Path of the printer in the “Shared path:” text field and your done. No more batch files, vbscripts or KIX scripts to edit and maintain for mapping printers…. NICE!!!

image

Also remember that you can also target this setting using Preference Item-Level Targeting using the traditional Security Group Targeting or you can be a little more dynamic and use IP Address Range Targeting or Site Targeting.

How to use Group Policy to restore missing second printer in Windows 7

Aamer Shedam from Microsoft’s Ask the Performance Team has just blogged about how Windows 7 will only show one printer in “Devices and Printers” if you have that same two printers installed on the one computer (see below).

win7_duplicate_printer

If your an IT Administrator and you want to configured the “Printer” view in Windows Explorer to show an icon for each printer using Group Policy then take a look at my instructions below.

Key: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{2227a280-3aea-1069-a2de-08002b30309d}
Value: (Default)
Data: Printers

Step 1. Edit a Group Policy Object that is applied to all the workstation you want this Browser Ballot disabled.

Step 2. Navigate to Computer Configuration > Preferences > Windows Settings > Registry and create a “New Registry Item”

Step 3. Type “SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{2227a280-3aea-1069-a2de-08002b30309d}” in the Key Path tick “Default”, then select REG_DWORD as the value type “Printers” in the value data and then click “OK”.

image 

Now all your computers will display this view in Windows Explorer.

Win7_PrinterView 

Links:

How to use Group Policy Preferences to dynamically map printers with Roaming Profiles

One of the great new feature with Group Policy Preferences is the ability to map printers based on a various number of criteria such as group membership, AD Site or even IP Address range to name a few. This allows for some powerful senarios such as being able to map all the printers physically near a user based on the computers IP address. Note: This assumes that the networking team allocates the same subnets to certain computers near each other (e.g. a building or floor) but I have found this is often the case.

One of the problems that occur when you map printers with Group Policy Preferences is that if the user has a roaming profile configured and they then logon to a computer that is located in another area they will have all also have their old printers from the previous area. Now user might not really notice these printer mapping building up over time but they can soon amass a large number of mappings that makes their computer run slow to logon.

Question? So how do you map all the printers in one location but not have them follow you to another location if you are using a roaming profile?

Answer? Is a two step solution which I will go through below. There is also an optional third step that address the problem maintaining default printer mappings once a user gets back to their normal location.

Step 1. The first part is just to create a simple printer mapping that maps the printer targeted by the IP address of the users current computer.

New Shared Printer

Figure1. Create New Shared Printer

The images belo shows the printer “\\server\printer1” being mapped for the users that logon to a computer that is in the 10.1.1.0/24 subnet. It is important to note that we are talking about the IP address range of the computer that you want to map the printer not the IP address range of the printer server or the printer NIC itself.

Target setting

Figure 2. Target setting to only be mapped for computers between 10.1.1.0 to 10.1.1.255

image

Figure 3. Resulting printer mapping

Step 2. The second step is to delete the printer mapping if the IP address of the printer does not fall within the IP address range that you want the printer to be mapped. To do this we start by copying the existing printer mapping that we made in step 1. This avoids making any typo’s in either the printer queue name of the IP addresses.

image

Figure 4. Copying the existing printer mapping made in step 1.

image

Figure 5. Paste the setting into an unused part of the pane

image

Figure 6. Both printer mapping entries

Now we make the changes to the action on the second printer mapping targeting so that it will remove the printer mapping when the user logs onto a computer in another area.

image

Figure 7. Open the properties of the second printer

image

Figure 8. Change the Action to “Delete”

image

Figure 9. Go back to the targeting and change it to an “Is Not” between “10.1.1.0” and “10.1.1.255”

image

Figure 10. New target rule

image

Figure 11. Two printer entries to map and then clean up the printer queues for a user based on their location.

Step 3. Maintaining Default Printer Mappings

You have now configured dynamic printer mapping for your user based on location of the user. However this solution does have one problem/annoyance, user normally like to set a default printer. If a user was to logon to a workstation in another location then return to their normal desk their default printer will have been reset as it will have been removed. To get around this problem we have to add another rult to the targeting on the Delete printer option so it does NOT delete if the printer is configured as the default printer. To do this we check the registry location that the default printer is saved and test to see if the printer we are deleting is the default printer.

So go back to the targeting option for the Delete printer action and add another test that will check to see if the printer is the default printer.

image

Figure 12. Add a new Item of type “Registry Match”

image

Figure 13. Configured Registry Match Setting

Change the Match Type to “Match value data” and the Value data match type to “Substring match” as the value we are looking for will contain other information as well that we don’t care about. Make sure the Hive is set to “HKEY_CURRENT_USER” and the Key Path is set to “Software\Microsoft\Windows NT\CurrentVersion\Windows”. The Value name “Device” is where in the registry the default printer information is saved. We then set the Substring to “\\server\printer1” which is the UNC path to the printer queue. Note: The substring value has to be exactly the same as the value set in the Path for the printer mapping.

There, now you know how to use Group Policy Preferences to map and remove network for users based on their physical location while avoiding the build up of mapping if your user have roaming profiles while still preserving their default printer.

Automate Group Policy Preferences printer-management using Windows PowerShell

Jan Egil’s has just written a good blog post explaining how to use Power Shell with Group Policy Preferences to easily setup multiple printer connections. If you have ever had to make printer connections with Group Policy Preferences you will know that it is a real easy to copy a printer connection. However it is a real pain to then modify the printer path and targeting… again… and again… and again… and again… Definitely worth a read if you use Group Policy Preferences to manage your printer connection in your organisation.

Check out the article at Automate Group Policy Preferences printer-management using Windows PowerShell « Jan Egil`s Admin-Blog

Group Policy Setting of the Week 4 – Shared Printer

This week I have selected the “Shared Printer” Group Policy Preference as my Group Policy Setting of the Week (GPSW). This is arguably one of the most wanted group policy settings by Group Policy admin’s that was missing before group policy preferences. It was possible previous to preferences to map printers natively in group policy using the pushprinterconnections.exe option but like the Star Trek Deep Space Nine episode “Trials and Tribble-ations” we defiantly “do not discuss it with outsiders” as this is just a setting we would rather forget.

The “Shared Printer” options can be found under by right clicking on “User Configuration > Preferences > Control Panel Settings > Printers”. As with most group policy preference settings you also have the option to CRUD (see Group Policy Preferences Colorful and Mysteriously Powerful Just Like Windows 7) which means you can also use this option to remove any printer mapping that people have to printer queues that no longer exist.

new shared printer

Now it has always been fairly straight forward to map printers via logon script either via batch, vbscript or even kix scrtip however the real power of this setting is that it can now take advantage of the really powerful targeting options. More commonly you can map a printer via a single security group or IP range but you can really start to do some really advance targeting when you start to combine multiple targeting setting using Boolean logic. If you want to see some more advanced targeting options for printer mappings then check out my “How to use Group Policy Preference to dynamically map printers when using Roaming Profiles” article.

new shared printer properties

As you can see above you can also use this option to set the default printer for your users which can be very handy if people have a habit of always printing to the really expensive A3 colour printer on your floor when you are trying to reduce cost. Just use the default printer option wisely however as you could end up annoying your manager who likes to printer to their locally attached printer.

Enjoy!