With the official end of support for Windows Server 2003 in July 2015, many Microsoft customers need to migrate their old servers to newer operating systems. This is true also for print servers. For many administrators, this is a significant time and logistical challenge, as existing print environments can’t simply be migrated on a 1 to 1 basis. In addition, when migrating it makes sense to eliminate unnecessary legacy printer settings, printers or ports.
The following example combines Microsoft Printbrm and Tpms.Powershell to migrate an existing print infrastructure to a new server operating system by creating each printer and port from scratch.
Note! Don’t use type-4 printer drivers for printer objects on ThinPrint Ports (see Overview of cmdlets).
1. On the new print server (Windows 2008 R2, 2012 or 2012 R2), open the Windows Print Management and access the old print server remotely.
2. Here, export the printer and port information using Export printers to a file in the context menu – e. g. to W2k3-printers.printerExport.
3. On the old print server, open the ThinPrint Port Manager if there is a ThinPrint Engine installed.
4. Here, export the ThinPrint Port information using All Tasks→ Import/Export→ Export Port Configuration in the context menu – e. g. to TP-ports.xml.
# Step 1
# Change to Tpms.Powershell and convert the export files created above – here W2k3-printers.printerExport and TP-ports.xml – as follows:
ConvertTo-TpmsMigrationScript -SourcePath c:\temp\W2k3-printers.printerExport -OutputPath c:\temp\printer-migration.ps1 ConvertTo-TpmsMigrationScript -SourcePath c:\temp\TP-ports.xml -OutputPath c:\temp\TP-ports.ps1
# Step 2
# Merge both PowerShell files to a single file. At the end of this new PowerShell file add the following lines:
$srv1 = New-TpmsObjApplyAgent -Name "newserver.testdom.local" -Port 5050 -Printers ($Printers) -Ports ($TcpIpPorts) $srv2 = New-TpmsObjApplyAgent -Name "newserver.testdom.local" -Port 5050 -Printers ($Printers) -Ports ($TpPorts)
Before running the script, please perform the following:
- change the target machine’s address newserver.testdom.local (see above) by your own print server address
- if necessary, add the SNMP status enabled option of Standard TCP/IP Ports by removing the relevant # signs from the Add-TpmsSnmpInfo lines
Note: Running the script with SNMP enabled will be time consuming because each relevant network printer will be connected by Windows.
- if necessary, change the relevant share names – defined by the -Name parameter of the cmdlet Add-TpmsSharingInfo
- if necessary, change the relevant printer driver names – defined by the –Driver parameter of the cmdlet New-TpmsObjPrinter
- to retrieve printer driver settings from other printer objects on the same machine, add template printer names – defined by the -Template parameter of the cmdlets New-TpmsObjPrinter and New-TpmsObjPrinterTpog
The easiest way is to firstly pre-install all relevant drivers by installing a printer object per driver, secondly setting the defaults of these printers, thirdly adapting the driver names in the script (see above) and fourthly adding the -Template parameter by replacing -Driver <driver_name> by -Driver <driver_name> -Template <driver_name> globally (providing that printer_name = driver_name).
If the template is on a remote machine, its name must be specified with FQDN address. Example:
-Template "\\cps48.ourdomain.local\Lexmark T644 (MS)".
- The service of the Tpms.Agent that creates the printers must run with an account that has the permission to access the share of the template located on the remote computer.
- to retrieve printer driver settings from printer objects on a ThinPrint Client Windows machine, append Add-TpmsClientInfo lines to the relevant New-TpmsObjPrinterTpog lines
# Step 3
Start-TpmsApplyByAgent -Action Deploy ($srv1,$srv2) | Format-TpmsDispatch
# Run the script.
Converting .printerExport and .xml type files to .ps1