BRONZE PARTNER:
BRONZE PARTNER:
Industry News:

| |
| |
 |
 |
 |
 |
 |
| SMS and Printui.dll |
 |
|
|
By: Mehrban Sawhney
Posted On: 2/22/2005
We had the old age problem of network printers not having a standard naming scheme and when I was told that we were to change the IP addresses of a few printers I knew that we had the perfect opportunity to combine the two issues and get them finally fixed. From the starting I decided to use SMS for the entire project.
Below is an example of how we used SMS to rename a HP4200 network printer.
1. Deployed MIFShift - Printers to get all my printer information into SMS. http://www.smsexpert.com/smsexpert/Downloads.asp
2.Exported a list of port names and printers from SMS and sorted them out by port names. (usually port names are the same as the IP of the printer since the default port name is IP_x.x.x.x)
3.Set up a test machine with the printer I wanted to configure.Configured the printer to our standard settings (A4 size paper and the everyone group gets full permission on the printer)
4.On the test machine exported the following key to HP_4200.reg in order to get the defined port name {HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\}
5.Ran the following command to export the permissions and other printer options (Paper size,Duplexing etc).The dat file is saved under \Documents and Settings\your_profile_name\
rundll32 printui.dll,PrintUIEntry /Ss /n "HP4200 in Room 14" /a "HP4200.dat"
6.Used SMS to deploy the following script to install the printer drivers:
REM this is to copy printer drivers,security and registry settings to users temp directory
copy \\share_name\PrinterDrivers\HP4200\*.* d:\temp /y copy \\share_name\PrinterDrivers\settings\*.* d:\temp /y
REM Delete all the below mentioned known printer ports (names from SMS)
start /wait rundll32 printui.dll,PrintUIEntry /dl /n"Room 14 Printer" /q start /wait rundll32 printui.dll,PrintUIEntry /dl /n"Printer 4200 14" /q start /wait rundll32 printui.dll,PrintUIEntry /dl /n"4200 Room14" /q
REM merge the registry for IP Port Names
regedit /s "d:\temp\HP_4200.reg"
REM stop and start printer spooler to get the printer ports up!
net stop spooler net start spooler
REM Install the printer REM HP 4200
start /wait rundll32 printui.dll,PrintUIEntry /if /b "HP4200 in Room 14" /f "d:\temp\hp4200p5.inf" /q /r "IP_x.x.x.x" /m "HP LaserJet 4200 PCL 5e" /z /u
REM Bring in the Security and Printer settings
rundll32 printui.dll,PrintUIEntry /Sr /n"HP4200 in Room 14" /a "d:\temp\HP4200.dat" s
REM stop and start printer spooler to get the printers up
net stop spooler net start spooler
7. Reran MIFShift - Printers to get the new printers into SMS
For more information
Windows Printing: Automatically Install Local Printers https://engineering.purdue.edu/ECN/Resources/KnowledgeBase/Docs/20040216090320/
|
 |
 |
 |
|
|