Friday, March 2, 2012

Install Print Server Role and Import Printers

#Clear Screen
cls

#Remove lingering variables
Remove-Variable * -Force  -ErrorAction SilentlyContinue

#Confirm that printbrm.exe is located in C:\Windows\System32\spool\tools\Printbrm.exe
#Import Server Manager module and add Printing roles
Import-Module ServerManager
Add-WindowsFeature "Print-Server", "Print-Services"

$SourceServer = 'SERVERNAME'
$backupdir = 'd:\AFScripts\PrinterSettings'

C:\Windows\System32\spool\tools\Printbrm.exe -s \\$SourceServer -r -f $backupdir

Export Printers to a New Print Server

#Clear Screen
cls

#Remove lingering variables
Remove-Variable * -Force  -ErrorAction SilentlyContinue

#Confirm that printbrm.exe is located in C:\Windows\System32\spool\tools\Printbrm.exe
$SourceServer = 'SERVERNAME'
$backupdir = 'd:\Scripts\PrinterSettings'
C:\Windows\System32\spool\tools\Printbrm.exe -s \\$SourceServer -b -f $backupdir