Storage Migration Service & printers

10 views
Skip to first unread message

Gordon Pegue

unread,
Feb 10, 2021, 12:15:05 PM2/10/21
to ntsys...@googlegroups.com

Easy question for the y’all:

 

I’m getting ready to migrate the contents of a Windows Server 2008 R2 file server over to a Windows Server 2019 file server using Storage Migration Service (SMS).

That part will be a slick piece of cake I expect thanks to the Storage Migration Service tool.

 

My question has to do with the network printers/queues I have installed on that 2008 R2 box…

 

Should I migrate them first or wait until after my SMS migration is complete to migrate the printers?

 

 

 

 

Thanks,

Gordon

Michael B. Smith

unread,
Feb 10, 2021, 12:53:43 PM2/10/21
to ntsys...@googlegroups.com

I don’t think it really matters.

--
You received this message because you are subscribed to the Google Groups "ntsysadmin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ntsysadmin+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntsysadmin/SJ0PR07MB7679F38B1CD5DF5096757BA5D38D9%40SJ0PR07MB7679.namprd07.prod.outlook.com.

Henry Awad

unread,
Feb 10, 2021, 12:59:10 PM2/10/21
to ntsys...@googlegroups.com
You can migrate them anytime. It doesn't matter.

Gordon Pegue

unread,
Feb 10, 2021, 1:08:08 PM2/10/21
to ntsys...@googlegroups.com

That’s kinda what I thought, but I wanted to bounce it off the wall for other opinions.

 

Thanks Henry and MBS.

 

 

Gordon

 

From: ntsys...@googlegroups.com [mailto:ntsys...@googlegroups.com] On Behalf Of Henry Awad
Sent: Wednesday, February 10, 2021 10:59 AM
To: ntsys...@googlegroups.com
Subject: Re: [ntsysadmin] RE: Storage Migration Service & printers

 

  [EXTERNAL]

Henry Awad

unread,
Feb 10, 2021, 4:46:36 PM2/10/21
to ntsys...@googlegroups.com
How are you planning to move your print queues and ports? If you want, I have a script that I can share with you that will get all the printer information from your current server and another script that will create them using a CSV file on your new server. I also recommend using universal print drivers if possible so that you only need a couple of drivers that you can specify in the CSV file for each print queue. It would require a bit of manual manipulation of the CSV file (mostly to assign the print driver for each queue but if you're using UPD then it's an easy copy and paste job). I was able to migrate a print server with close to 200 print queues in about 45 minutes. I also recommend using a CNAME for mapping printers (print.yourdomain.com and point it to your print server) so that you don't have to remap your printers on the next server upgrade if you're not already doing that. In order for CNAME mapping/connections to work, you will need to add a registry key on your print server as detailed in this link:
Windows couldn't connect to the printer - Windows Server | Microsoft Docs

Henry Awad
Senior Systems Engineer
Technology Services
The Catholic University of America


Gordon Pegue

unread,
Feb 10, 2021, 5:56:38 PM2/10/21
to ntsys...@googlegroups.com

My plan was to use Windows Admin Center and connect to my 2019 server.

From there, I’ve read that I can use the Print Management snap-in to export the printers on the 2008 R2 box to a file/collection which can then be imported into the 2019 box:

https://docs.microsoft.com/en-us/archive/blogs/canitpro/step-by-step-migrating-print-servers-from-windows-server-2008-to-windows-server-2012

 

I don’t have a lot of printers to migrate (<20) so after migrating, if there’s issues, I can sort them out manually.

 

I would however be interested in taking a look-see at your scripts if you’ve a mind to share.

Much obliged in advance Henry.

Gordon Pegue

unread,
Feb 10, 2021, 6:11:23 PM2/10/21
to ntsys...@googlegroups.com

Whoops, mistyped.

I don’t use WAC to do this, I do it directly on the 2019 box…

Denes, Laszlo

unread,
Feb 12, 2021, 8:23:57 AM2/12/21
to ntsys...@googlegroups.com

Unrelated but curious are you using DFS namespace?

Will have to do this next year myself so keen to find out from you how it worked out with SMS as I used robocopy the last time I had to do it and although it worked okay, it was not great or flawless.

 

Laszlo Denes

Technical Analyst Servers

Information Systems

t: ext. 214

lde...@torontograce.org

 

From: ntsys...@googlegroups.com [mailto:ntsys...@googlegroups.com] On Behalf Of Gordon Pegue
Sent: Wednesday, February 10, 2021 12:15 PM
To: ntsys...@googlegroups.com
Subject: [ntsysadmin] Storage Migration Service & printers

 

CAUTION: External mail. Do not open attachments or click links that you do not trust.

--

You received this message because you are subscribed to the Google Groups "ntsysadmin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ntsysadmin+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntsysadmin/SJ0PR07MB7679F38B1CD5DF5096757BA5D38D9%40SJ0PR07MB7679.namprd07.prod.outlook.com.

________________________________________
NOTICE: This message, including any attachments, may contain privileged or confidential information and is intended for use only by the individual to whom it is specifically addressed (or those responsible for the delivery of the message to such person). Any distribution, copying or disclosure is strictly prohibited without the written consent of the sender. If you are not the intended recipient or have received this message in error, please notify us by reply email and permanently delete the original transmission from us. Thank you for your cooperation. If you have any questions about this message please contact the Information Systems Department, Salvation Army Toronto Grace Health Centre, 650 Church St., Toronto, ON M4Y 2G5. Phone: (416) 925-2251

Heaton, Joseph@Wildlife

unread,
Feb 12, 2021, 11:12:29 AM2/12/21
to ntsys...@googlegroups.com

I would be interested, as well.  As in, how long does it take with SMS?  We migrate file servers every year (field offices, 5-yr rotation), and we use robocopy.  Initial sync a few days before, then a final sync on the night of cutover.

 

From: ntsys...@googlegroups.com <ntsys...@googlegroups.com> On Behalf Of Denes, Laszlo
Sent: Friday, February 12, 2021 5:24 AM
To: ntsys...@googlegroups.com
Subject: [ntsysadmin] RE: Storage Migration Service & printers

 

Warning: This email originated from outside of CDFW and should be treated with extra caution.

 

Henry Awad

unread,
Feb 15, 2021, 11:54:43 AM2/15/21
to ntsys...@googlegroups.com
Sorry for the late reply but I was working on upgrading my VMware hosts last week. Here's how I automated the upgrade of my print servers:

  1. Get list of all existing printers on a server:

Run the following PowerShell command:

Get-Printer -ComputerName yourservername | Format-Table -Wrap > C:\temp\printer_list.txt


You will use the information from this output as input for the other scripts


  1. Create DHCP Reservations using PowerShell

    1. Create a csv file with the following columns: ScopeId, IPAddress, Name, ClientId, Description (ClientId is the MAC address of the printer)

    2. Rung the following command in PowerShell: Import-Csv –Path “C:\temp\Printer_Reservations.csv” | Add-DhcpServerv4Reservation –ComputerName “yourservername

  2. Create printer ports on printer server:

    1. Create a csv file with the following column: Name, PrinterHostAddress, ComputerName

    2. Run the following command in PowerShell: 

$PortList = Import-Csv -Path "C:\temp\PrinterPort.csv"

forEach ($port in $portlist) {Add-PrinterPort -Name $Port.Name -PrinterHostAddress $Port.Name -ComputerName yourservername}


4- Install drivers on new print server (I used Universal Print Drivers so I only needed 2 drivers for over 200 printers)

5- Run the PowerShell script below


Save the text below as a .ps1 file:
function CreatePrinterPort { 
$server = $args[0] 
$port = ([WMICLASS]“\\.\ROOT\cimv2:Win32_TCPIPPrinterPort”).createInstance() 
$port.Name= $args[1] 
$port.SNMPEnabled=$false 
$port.Protocol=2 
$port.HostAddress= $args[2] 
$port.Put() 
}

function CreatePrinter { 
$server = $args[0] 
$print = ([WMICLASS]“\\.\ROOT\cimv2:Win32_Printer”).createInstance() 
$print.drivername = $args[1] 
$print.PortName = $args[2] 
$print.Shared = $true 
$print.Published = $false 
$print.Sharename = $args[3] 
$print.Location = $args[4] 
$print.Comment = $args[5] 
$print.DeviceID = $args[6] 
$print.Put() 
}

$printers = Import-Csv “printers.csv”

foreach ($printer in $printers) { 
CreatePrinterPort $printer.Printserver $printer.Portname $printer.IPAddress 
CreatePrinter $printer.Printserver $printer.Driver $printer.Portname $printer.Sharename $printer.Location $printer.Comment $printer.Printername 
}

Hope this helps and please let me know if you have any questions.

Henry Awad
Senior Systems Engineer
Technology Services
The Catholic University of America

Kurt Buff, GSEC/GCIH/PCIP

unread,
Feb 15, 2021, 1:33:44 PM2/15/21
to ntsys...@googlegroups.com
Oh Oh. There are smart quotes in that snippet.

Whoever copies that out will have to correct it, or it might cause problems.

Kurt

Henry Awad

unread,
Feb 15, 2021, 1:36:09 PM2/15/21
to ntsys...@googlegroups.com
I can re-send it as a text file attachment if Google will not flag it.

Kurt Buff, GSEC/GCIH/PCIP

unread,
Feb 15, 2021, 1:42:11 PM2/15/21
to ntsys...@googlegroups.com
Probably not needed. A quick Search/Replace will fix it, or even manually inspection/correction will do for such a small piece of code.

Kurt

Gordon Pegue

unread,
Feb 15, 2021, 3:03:47 PM2/15/21
to ntsys...@googlegroups.com

Thanks for the detailed methodology/scripts you provided Henry.

 

I’ve already successfully migrated my print queues/ports/drivers using the Print Management features on my source and destination servers.

It was very slick and took less than 15 minutes to migrate my handful of Ricoh, OKI and HP devices.

Testing after the migration was flawless.

 

Gordon

 

From: ntsys...@googlegroups.com [mailto:ntsys...@googlegroups.com] On Behalf Of Henry Awad


Sent: Monday, February 15, 2021 9:55 AM
To: ntsys...@googlegroups.com

Subject: Re: [ntsysadmin] RE: Storage Migration Service & printers

 

  [EXTERNAL]

Sorry for the late reply but I was working on upgrading my VMware hosts last week. Here's how I automated the upgrade of my print servers:

 

  1.  

2.       Get list of all existing

3.        printers on a server:

  1.  

Run the following PowerShell command:

Get-Printer -ComputerName yourservername | Format-Table -Wrap > C:\temp\printer_list.txt



You will use the information from this output as input for the other scripts

 

  1.  

3.       Create DHCP Reservations

4.        using PowerShell

  1.  
    1.  

b.      Create a csv file with

c.        the following columns: ScopeId, IPAddress, Name, ClientId, Description (ClientId is the MAC address of the printer)

    1.  
    2.  

f.        Rung the following command

g.        in PowerShell: Import-Csv –Path “C:\temp\Printer_Reservations.csv” | Add-DhcpServerv4Reservation –ComputerName “yourservername

    1.  
  1.  

7.       Create printer ports on

8.        printer server:

  1.  
    1.  

a.       Create a csv file with

b.       the following column: Name, PrinterHostAddress, ComputerName

    1.  
    2.  

e.      Run the following command

f.         in PowerShell: 

Henry Awad

unread,
Feb 15, 2021, 3:21:43 PM2/15/21
to ntsys...@googlegroups.com
Glad that the Print Management features worked for you. I would have tried it if I wasn't making a lot of changes to my environment. I was changing IPs for the print queues/ports so I needed to also create new DHCP reservations. I also moved away from individual drivers to UPD. I also took the opportunity to remove old print queues that were no longer in use. That's why I used this method. 

Hopefully it will be helpful for some else. 

Philip Elder

unread,
Feb 15, 2021, 10:45:29 PM2/15/21
to ntsys...@googlegroups.com

@Henry Awad: That’s an awesome script thank you for sharing it!

 

VSCode with the PowerShell Extension picks up on that as the encapsulated portion doesn’t get highlighted like it should.

 

The way the wiring in my brain is coding for me is intimidating at the best of times. With the encouragement of fellow MVP Ben Thomas I got into VS Code.

 

https://www.mpecsinc.com/powershell-paradise-installing-and-configuring-visual-studio-code-vs-code-and-git/

^^^

This is the process I now use to set up VS Code and the necessary extensions. It’s awesome. 😊

 

Philip Elder MCTS

Microsoft High Availability MVP

E-mail: Phili...@mpecsinc.ca

Phone: +1 (780) 458-2028

Web: www.mpecsinc.com

Cloud: www.CanadianCloudWorx.com

Blog: blog.mpecsinc.com

Twitter: Twitter.com/MPECSInc

Skype: MPECSInc.

 

Please note: Although we may sometimes respond to email, text and phone calls instantly at all hours of the day, our regular business hours are 8:00 AM - 5:00 PM, Monday thru Friday.

 

From: ntsys...@googlegroups.com <ntsys...@googlegroups.com> On Behalf Of Kurt Buff, GSEC/GCIH/PCIP
Sent: February 15, 2021 11:33
To: ntsys...@googlegroups.com
Subject: Re: [ntsysadmin] RE: Storage Migration Service & printers

 

Oh Oh. There are smart quotes in that snippet.

 

Whoever copies that out will have to correct it, or it might cause problems.

 

Kurt

 

On Mon, Feb 15, 2021 at 9:54 AM Henry Awad <aw...@cua.edu> wrote:

Sorry for the late reply but I was working on upgrading my VMware hosts last week. Here's how I automated the upgrade of my print servers:

 

  1. Get list of all existing printers on a server:

Run the following PowerShell command:

Get-Printer -ComputerName yourservername | Format-Table -Wrap > C:\temp\printer_list.txt

 

You will use the information from this output as input for the other scripts

 

2.       Create DHCP Reservations using PowerShell

a.       Create a csv file with the following columns: ScopeId, IPAddress, Name, ClientId, Description (ClientId is the MAC address of the printer)

b.       Rung the following command in PowerShell: Import-Csv –Path “C:\temp\Printer_Reservations.csv” | Add-DhcpServerv4Reservation –ComputerName “yourservername

3.       Create printer ports on printer server:

a.       Create a csv file with the following column: Name, PrinterHostAddress, ComputerName

b.       Run the following command in PowerShell: 

Henry Awad

unread,
Feb 16, 2021, 4:00:47 PM2/16/21
to ntsys...@googlegroups.com
As much as I would love to take credit for it, I actually found this script on the web. It's listed in a couple of community forums so not sure where the original came from or even if I found it there originally: 




Reply all
Reply to author
Forward
0 new messages