Need script to remove specific printers before move to new domain

Short notice and new to qmm. I'm local IT and corporate gave me qmm to use for migration to a new domain.   Corporate basically said here's the procedure so we started down the path. I'm now discovering we can do some scripting, renaming, etc and haven't really even had the chance to look for docs/how-to's.

I'm hoping someone can give a quick hand and may have something built I can modify or point me in a direction.  I have a new print server on the destination domain with group policies adding printers (new names) and prior to moving the pc's I'd like to simply remove any printers from the old/current domain's print server, locally attached printers need to remain (some via usb, some via direct tcpip add).

I've looked in C:\Program Files (x86)\Quest Software\Migration Manager\Active Directory\Sample Scripts\ but nothing exists except for the exchange processing wizard so I'm guessing when corp installed qmm they pulled anything not directly related to our migration. Disappointed

edit - 

this would I believe have to run for each profile that is migrated as well.  I'm hoping to not have to have it run as a logon script per user after the fact or similar -- would like it to be part of the qmm task/process.

Yes, I can uncheck the processing of printers but that would also remove the local or ip attached printers.

in powershell, something similar to this would work as a logon type script

$PrintServer = "\\PServ1"
$Printers = Get-WmiObject -Class Win32_Printer
ForEach ($Printer in $Printers) {
If ($Printer.SystemName -like "$PrintServer") {
(New-Object -ComObject WScript.Network).RemovePrinterConnection($($Printer.Name))
}
}

or similarly in vbscript, but more destructive

Set networkPrinters = objWMI.ExecQuery("Select * From Win32_Printer Where Network = true")
For Each networkPrinter in networkPrinters
networkPrinter.Delete_
Next

Thanks!

Eric

Parents Reply Children
No Data