Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

https://docs.microsoft.com/en-us/powershell/module/printmanagement/get-printer?view=win10-ps

https://docs.microsoft.com/en-us/powershell/module/printmanagement/add-printer?view=win10-ps

#Fine and Dandy for Local Server, but what if I want to check \\Server\NABV001?
$printservers = @($DEFSERVER,$DUPSERVER)
$printservers | ForEach-Object {
 $printercheckboool = Get-Printer -Name $_ -ErrorAction SilentlyContinue
 IF (!$printercheckboool) {
  ECHO "$_ PRINTER_NOT_FOUND!"
  ECHO LISTING_PRINTERS_INSTALLED
  Get-Printer
  EXIT
 }
}

Set Default:

https://docs.microsoft.com/en-us/powershell/scripting/samples/working-with-printers?view=powershell-7#setting-a-default-printer

(New-Object -ComObject WScript.Network).SetDefaultPrinter('HP LaserJet 5Si')
  • No labels