Printer managment

Home Forums Scripting PowerShell Printer managment

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    MisterO
    Member
    #164390

    Hi

    Im looking for a PS script that will batch change all printerqueus to what ever default setting I need

    In my case its almost allways to change to mono/duplex

    I found scripts to batch install printqueus from CSV and a script to change all to winpint processor….mono/duplex script is kind of last piece of the puzzle for me
    Would save lots of work

    Anyone here familiar with a script like that?

    (Most of my servers are still on 2008R)

    come to think of it , would it be possible with PS to chnage all queus that currently have one specific driver to another.
    Like, All queues with driver version1.2.3.4 chnage to 2.3.4.5

    ***this script seems to change to duplex, atlest if the printqueue is shared**
    So now it feels like I just miss how to set mono

    $host.Runspace.ThreadOptions = “ReuseThread”
    Add-Type -AssemblyName System.Printing
    $permissions = [System.Printing.PrintSystemDesiredAccess]::AdministrateServer
    $queueperms = [System.Printing.PrintSystemDesiredAccess]::AdministratePrinter
    $server = new-object System.Printing.PrintServer -argumentList $permissions
    $queues = $server.GetPrintQueues(@([System.Printing.EnumeratedPrintQueueTypes]::Shared))

    foreach ($q in $queues) {
    #Get edit Permissions on the Queue
    $q2 = new-object System.Printing.PrintQueue -argumentList $server,$q.Name,1,$queueperms

    #Set DefaultPrintTicket
    $duplexCaps = $q2.GetPrintCapabilities().DuplexingCapability
    if ($duplexCaps.Contains([System.Printing.Duplexing]::TwoSidedLongEdge)) {
    $q2.DefaultPrintTicket.Duplexing = [System.Printing.Duplexing]::TwoSidedLongEdge
    $q2.commit()
    }
    }[/CODE][CODE]$host.Runspace.ThreadOptions = “ReuseThread”
    Add-Type -AssemblyName System.Printing
    $permissions = [System.Printing.PrintSystemDesiredAccess]::AdministrateServer
    $queueperms = [System.Printing.PrintSystemDesiredAccess]::AdministratePrinter
    $server = new-object System.Printing.PrintServer -argumentList $permissions
    $queues = $server.GetPrintQueues(@([System.Printing.EnumeratedPrintQueueTypes]::Shared))

    foreach ($q in $queues) {
    #Get edit Permissions on the Queue
    $q2 = new-object System.Printing.PrintQueue -argumentList $server,$q.Name,1,$queueperms

    #Set DefaultPrintTicket
    $duplexCaps = $q2.GetPrintCapabilities().DuplexingCapability
    if ($duplexCaps.Contains([System.Printing.Duplexing]::TwoSidedLongEdge)) {
    $q2.DefaultPrintTicket.Duplexing = [System.Printing.Duplexing]::TwoSidedLongEdge
    $q2.commit()
    }
    }[/CODE]

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.