I am trying to trouble shoot a GPO to deploy a printer and I need to see what network printers are on a remote machine for the current logged on user. When I do this
Get-WMIObject Win32_Printer -ComputerName PCNAME
I get a list of the local installed printers and when I try this
Get-WMIObject Win32_Printer -ComputerName PCNAME | where{$_.Name -like “*\\*”} | select sharename,name
I get nothing. Any help? I am using PowerShell 4.0 so the Get-Printer
doesn't work.
I borrowed heavily from tukan's code in another thread (thanks... that code bridged a gap I had not yet been able to bridge) and modified it to my purposes.
The code below determines the logged-in user on the specified remote computer, then outputs the printers that user has listed in the Registry under HKU<SID>\Printers\Connections.
As a bonus I added a couple extra lines that output the user's currently-selected default printer.