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.

Remotely as in via command line. Not sure if there's a reg key or something similar I can peek at to see if a user has the correct printers mapped.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

Well, you can take a look at the Win32_Printer WMI class,

Get-WMIObject Win32_Printer -ComputerName $Comp

But, I think this will get you even better results:

New-PSSession $Comp | Enter-PSSession
Get-ChildItem Registry::\HKEY_Users\$UserSID\Printers\Connections
Exit

Without using PS Remoting, you could do this instead:

$Printers = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey(Microsoft.Win32.RegistryHive]::Users, $ServerName)

You get the idea. Basically, you need to access that user's registry key with whatever method and enumerate whatever you find in Printers\Connections.

share|improve this answer
    
+1, and just for grins, check this link: powershell.com/cs/media/p/16643.aspx since they try to get all fancy with voice, etc. –  TheCleaner Dec 9 '13 at 15:58
    
The gci Registry::\.... is about to roll up nicely into a powershell function, fyi. –  BigHomie Mar 25 at 15:11

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.