Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm having issues listing all the printers on a computer using Powershell.

We have a batch script that will add/remove/list "per computer" printers using PrintUI.

I can use PrintUI to list the printers.

    rundll32 printui.dll,PrintUIEntry /ge /c"%UNC-NAME%"

This will list just the per computer printers, while...

    Get-WMIObject -Class Win32_Printer -ComputerName $ComputerName

will list the all printers in WMI.

In the above example I have a system that has 3 printers, when a user is logged in. WMI see's 2 of them, PrintUI see's 1.

I'm boggled how I can list them ALL! So that I can script auditing/adding/removing both "per computer" and "local" printers

share|improve this question
2  
Do you mean "both 'per computer' and 'per user' printers"? Users may add their own printers in addition to the per-computer ones. Do you need to iterate all user profiles on the computer, or just the current active profile? –  jscott Aug 22 '12 at 2:01
    
I know I can't see "per user" printers, but I'm looking for all printers that ALL users would see on a computer. "per computer" and "local" Ideally, I would be running this remotely, so my tech does not have to go to each computer to add/remove printers. If a user adds their own to their profile, I don't care. But I want to make sure we can see what printers are available within one view. –  Schlauge Aug 22 '12 at 14:27
    
In your scenario what is the difference between "local" and "per computer"? –  Mike Aug 24 '12 at 12:30
    
A "Local" printer is a printer assigned to a local port. This might be LPT: or even a TCP-IP port (still network, but directly from PC->Printer). A "per computer" printer is printing through another computer's printer spooler \\PrintSpooler\P23S If the user connect directly to \\PrintSpooler\P23S this is "per user" If I use rundll32 printui.dll,PrintUIEntry /ga /c\\PCName /n\\PrintSpooler\P23S It will make the network printer available for all users who login to PCNAME –  Schlauge Aug 25 '12 at 1:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.