[Samba] adding printers from netlogon script

Kurt Pfeifle kpfeifle at danka.de
Tue Dec 9 22:51:06 GMT 2003


> [Samba] adding printers from netlogon script
> Andrew Gaffney agaffney at technaut.darktalker.net
> Tue Dec 9 21:28:45 GMT 2003
> 
> 
> Kurt Pfeifle wrote:
>>> [Samba] adding printers from netlogon script
>>> Andrew Gaffney agaffney at technaut.darktalker.net
>>> Tue Dec 9 20:10:07 GMT 2003
>>>
>>>
>>> While this doesn't relate specifically to Samba, I need to do this in 
>>> a netlogon .bat file in a Samba domain. In my network, I have a 
>>> printer hooked to a JetDirect so that it is a TCP/IP printer. Is there 
>>> a way I can automatically have this printer mapped/added when the user 
>>> is logged on?
>>>
>> 
>> Test this command from a "DOS box":
>> 
>>    rundll32 printui.dll,PrintUIEntry /in /n 
>> \\printerserver\printersharename
>> 
>> If it works, it can go into the logon script. (Of course "printersharename"
>> needs to exist on "printerserver" and must have printer driver deposited on
>> the server's [print$]-share for "point'n'print" download...). And:
>> 
>>    rundll32 printui.dll,PrintUIEntriy /?
>> 
>> will show up a full "man page" (hehe...)
>> 
>> See also
>> 
>>    http://de.samba.org/samba/docs/man/printing.html#id2931140
> 
> Will this same method work to add a TCP/IP printer instead of a SMB printer?

No.

This method adds a "network printer" (Microsoft terminology for a printer
that is hanging off or is served via a print server).

I assume you want a "JetDirect" printer (or LPD or IPP) with a network
card of its own? This, in Microsoft-speak, is a "local printer".

Assuming you have already a "local printer port" present on your system
named "my_printer_tcpip_port" (know that you can give local ports any name
you want in Win2K and WinXP, if you use the "Standard TCP/IP Port" they offer;
usually it tries to suggest a name like "IP_192.168.1.1" if you choose to
use an IP address for the "printername or IP Adress" field...), here is
the commandline (untested):

   rundll32 printui.dll,PrintUIEntry /if /b "My Printer Name" /f %windir%\inf\ntprint.inf /r "my_printer_tcpip_port" /m "AGFA-AccuSet v52.3"

Note that you can use any *.inf file describing a printer driver
installation and the associated driver name. The one I've choosen
here should be present on each WinNT/2K/XP system and work for
everyone to test...


But again; please take the trouble to read that Microsoft "man page"...



More information about the samba mailing list