• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3186
  • Last Modified:

Mapping printers using a NetBIOS alias

I am configuring the majority of my network printers on a server called FILESRV01.  I have given this server the NetBIOS alias PRINTER, and I want all users to map their printers using the alias, so that if I ever change the name of this server or move the printers to another server, no desktop reconfiguration will be required.

I have published the printers in Active Directory using the PRINTER alias, and the printer objects in AD are named according to the alias.  However, when I search for a printer using the "Find printer in the directory" option in the Add Printer Wizard, the printers listed are identified as being on FILESRV01 rather than PRINTER, and if I select one of these printers, it is mapped locally as "<printer name> on FILESRV01.

For example, I have a printer called LaserJet05, and when I published it in AD, I used the UNC "\\PRINTER\LaserJet05".  The printer object was automatically named "printer-LaserJet05".  However, when I add a printer on a client computer using the Add Printer Wizard's "Find printer in the directory" option, the server name for LaserJet05 shows up as FILESRV01, and if I select it, I get a network printer in my profile called "LaserJet05 on FILESRV01".  I want to have the printer mapped as "LaserJet05 on PRINTER", so that if the alias PRINTER is moved to another server, or FILESRV01 is renamed at some point in the future, the users' mappings to the printer will not need to be changed.

To make sure that there is no confusion regarding what the issue is, I'd like to clarify:  
- I have disabled strict name checking in the registry on FILESRV01
- I have verified that it is possible to explicitly map a printer using the PRINTER alias – if I select the "Connect to this printer" option in the Add Printer Wizard and provide the UNC "\\PRINTER\LaserJet05", then I get a network printer called "LaserJet05 on PRINTER".
- Printers mapped using the alias PRINTER rather than the primary name FILESRV01 work fine, and I have verified that if the PRINTER alias is moved to a different server that has a printer with the same name and same driver, the change is seamless to users that have the printer mapped using the alias.

The problem is not with getting printers mapped using the alias to work, the problem is that I want users to be able to use a directory search to find printers, and have the printers mapped using the alias rather than the print server's primary name, but despite the fact that I published them in AD using the alias, and the AD object was automatically named using the alias, directory searches find the server's primary name instead.
  • 2
1 Solution
That's because there is no such object in the Directory called "PRINTER" - it's a DNS alias, not an actual object.  The LDAP search will only bring up objects in the Directory.

The only way to automate this would be via scripting called by a logon script.  

AvivaUSAAuthor Commented:
It's not just a DNS alias, it's a NetBIOS alias that FILESRV01 registers and recognizes as its own (I did also create a CNAME in DNS, but that's peripheral).  As for the objects in the directory, if we're talking about the printer objects, as I mentioned above, I created them using the alias, and the objects are named "PRINTER-<printer name>".  When you create a new printer object, you provide a UNC, not an object name, and AD automatically names the object based on the UNC, e.g. if you create a printer object and enter the UNC "\\server\printer_name" in the "New Object - Printer" dialog box, the object will be named "server-printer_name".  In this particular example, I entered the UNC "\\PRINTER\LaserJet05", and AD named the object "PRINTER-LaserJet05".  So, the objects in the directory, as far as I can tell, refer only to the alias name, not the primary name.

However, it just occurred to me that I might be overlooking the obvious.  Perhaps, despite the object's name, the object has some attribute that points it to the print server's primary name.  I'll have to check into that.

(Note, BTW, that I'm not trying to automate anything.  I just want the printers to be configured using an alias that I can transfer from server to server as necessary, rather than having clients point to a particular server.  Having to remap printers using a script if the print server name changes is exactly what I'm trying to *avoid* by doing this.)
AvivaUSAAuthor Commented:
That's exactly what it turned out to be.  AD names the printer object according to the UNC you provide, but the attributes that determine the server name and UNC returned in a directory search point to the server's primary name.  The attributes are serverName and uNCName.  So, in the example above, the object "PRINTER-LaserJet05" had serverName set to "FILESRV01", and uNCName set to "\\FILESRV01\LaserJet05".  I changed them with ADSI Edit to "PRINTER" and "\\PRINTER\LaserJet05", respectively, and now everything works the way I wanted it.  Pretty silly if you ask me, the printer object should be created using the name provided.

Please close this question and PAQ.
PAQed with points refunded (500)

Community Support Moderator

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now