Get-Printer only shows local printers

hi all,

on our network on a windows 8.1 PC I am running: Get-Printer -ComputerName xxxxx

I only get the local printers it doesn’t return the network printers.
I have done lots of searching and couldn’t find anything about this or more to the point about this problem.

Any ideas ?

If you run “Get-Printer” on your localhost as the logged in user you will also see your network printers.
But if you run it as an administrator you won’t see them.

Why?
Because network printers that are shared from another server are per user, when you log in as a user which has the network printer mapped on a computer
it will be created in that users session.

The same thing happens when you try to use “Get-Printer” on a remote computer, thats why you only see the local printers.

/Alexander

Hi Alexander,

Thanks for your reply.
I was wondering what is going on. :slight_smile:

ok is there away, if you can direct me the right way, to use the Get-printer for a specific user?

Well, one option would be to read the registry entries of the current user. The network printers are listed under HKCU\Printers\Connections

I suggest that you take a look at this thread:
http://stackoverflow.com/questions/20639541/get-default-printer-remotely

/Alexander

hi Deiandrel and Alexander

again just a big thank you for taking the time and helping much appreciated.

I saw a few version of this script that I wrote yesterday (at home I found that someone already wrote this and did a better job :slight_smile: )

I am testing to see if this will delete the printers regarding of the user logged to the PC if this will work then I’ll be very happy and will let you know.

Function Delete-networkPrinters {

$netprinters = Get-WmiObject -Class win32_Printer | where-object{$_.network}
If ($netprinters -ne $null)

{ 
    Foreach($netprinter in $netprinters)
    
    {
       $netprinter.Delete()
        Write-Host "the following printers were removed" + $netprinter.name
    }
 }

 Else{read-host "no printers found"}   

}

Delete-networkPrinters

this scripts is now working well and its simple ( I am new to powershell and like simple :))