5

I'm working on a new print server running Windows Server 2008 R2. The shared printers will be listed in Active Directory. The print server has a host record with one name, but I want to users to connect using a different name, setup via a cname record on the dns server.

The problem is that these shared printers are listed in Active Directory using the host A record. I can choose to add the printer via the \\cname\printername share, but if I find the printer in Active Directory it will connect to the printer on the user's computer via \\hostname\printername instead, and this difference is highly visible to end users. I would like the printers to be listed using the cname record, such that when users connect to a printer all they see is the cname.

Is this possible?

Joel Coel
  • 12,910
  • 13
  • 61
  • 99

3 Answers3

4

I was looking for a solution to this same problem and found that the "uNCName" property of the printqueue object in AD simply needs to be changed from \\servername.domain.com\printerName to \\alias.domain.com\printerName. Scripts to accomplish this are available here: http://jthiede.wordpress.com/2012/08/20/list-a-printer-in-active-directory-using-a-cname/. The scripts use Quest Active Roles (http://www.quest.com/powershell/activeroles-server.aspx) so that will need to be installed wherever you run the scripts. Here is the basic syntax:

set-QADobject SERVER-printer -objectattributes @{servername=”alias.domain.com”;shortservername=”alias”;uNCName=”\\alias.domain.com\printer”}

Hope this helps!

-Jason

user132976
  • 81
  • 3
  • Awesome. Still need to do this manually whenever I add a printer, but it's not that big of a deal. Thanks. – Joel Coel Aug 21 '12 at 23:33
  • 1
    Glad you found it helpful. You can actually set a scheduled task triggered by an event 306 in the PrintService event logs (if you enable those logs) to run the script for you. I setup a new queue today and it triggered the script when I listed it in the directory. – user132976 Aug 21 '12 at 23:58
1

You need to register the SPN's into active directory.

setspn.exe –a host/CNAME computerobject

Reference: http://daddyr.blogspot.com/2010/12/cname-on-windows-2008-r2-server-print.html

  • 3
    Warning that this will affect all services published by the server in Active Directory, not just Printers. – Chris S Jun 07 '12 at 20:32
  • 1
    Edited the answer to reflect the additional step necessary for AD advertisement. – jfalcon aka Don Fanning Jun 07 '12 at 20:48
  • Doesn't work... I can already manually add a \\cname\printername share, which is what that post covers. The problem is that if I find the printer in active directory it connects via \\hostname\printername instead, and I want to active directory to use the cname when users connect to the printer. – Joel Coel Jun 07 '12 at 22:56
1

Use ADSI Edit.

Browse to the server object.
CN=Servername,CN=Computers,DC=Domain

Locate the printer you want to change and open the properties.

CN=Servername Printername

In attribute editor, scroll down to "serverName", modify the value to what ever you want.

slm
  • 7,355
  • 16
  • 54
  • 72
Ash Hyena
  • 11
  • 1