When setting up migration of Windows XP to Windows 7 or just plain "ordinary" deployment with SCCM 2007, IP based printers are treated as local printers and are not migrated.
This may be problem in environment where majority of printers are setup as IP based printers.
One way to solve this would be to write a script to capture all local printers and import them back on the new machine. The problem with this solution is that most of the old printers may be transferred, sometimes not all the drivers are available for the new platform, etc.
So the decision was to document the current state and decide what printers to keep and create a package and printer definition file to add printers during final stages of the task sequence.
The script must add a local IP Port - here is Windows 7 command:
c:\windows\System32\Printing_Admin_Scripts\en-US\Prnport.vbs -a -r IP_IPAddress -h IPAddress -o raw -n 9100
Adding Printer - with following command:
rundll32 printui.dll,PrintUIEntry /if /b "Base Printer Name" /n "Printer Name" /u /f "inf file" /r "IP_PortName" /m "PrinterDriverModelName"
Note that the PrinterDriverModelName must be exact, no extra spaces or missing characters.
To get more info on the command just run:
rundll32 printui.dll,PrintUIEntry
The idea for the main script is that the script will read the definition CSV file, search for computer name and then create port(s) and printer(s). So the CSV file needs to contain Computer name, IP Address, Printer Name, Printer Driver Name, Inf File Location.
First part of the script reads the file and creates the array - I did not reinvent the wheel and found this universal function made by HunBug.
Download the addprinters.vbs
Download definition template printers.cvs
No comments:
Post a Comment