Figure out what default printer is being used by an employee.

Posted on 2004-10-21
Last Modified: 2010-04-13
I want to see if there is a way that a all users profiles can be queried to show the default printer.  
Question by:a_selvaggio
    LVL 27

    Expert Comment

    by:Asta Cu
    Hmmm printer defaults is usually at the end-user profile level.... thinking
    LVL 27

    Assisted Solution

    by:Asta Cu
    Until someone pops by with exactly what you need,  perhaps this will be of help
    \documents and settings\   all profiles including system profiles "should say".... but unclear.

    Are all service packs applied?
    LVL 27

    Assisted Solution

    by:Asta Cu
    LVL 76

    Assisted Solution

    by:David Lee
    It depends on what you mean by "all users profiles".  If that means to check all users as each one logs in, then I'd say that's pretty easy.  If instead it means to check all users from a central point without the user being logged in, then I don't think that's doable.  And if it means to check all the profiles on a given machine all at once, without the user being logged in, then I'd say that might be possible, but it'd be difficult at best.

    Perhaps if you shared a bit about the intended goal we'd be in a better position to recommend a solution.
    LVL 4

    Assisted Solution

    There is a registry key you can read to get the users defaut printer

    HKCU\Software\Microsoft\Windows NT\currentVersion\Windows\Device

    If you are happy using vbscript you can use some code like this to find what you want

    'Create a wscript shell object
     Set WshShell = WScript.CreateObject("WScript.Shell")

    'Get the default printer
    defaultPrinterReg = WshShell.RegRead("HKCU\Software\Microsoft\Windows NT\currentVersion\Windows\Device")

    I had to use this to find the users default printer and if it was a certain printer set it to another one. If it wasn't then leave it alone. (To many people were printing by default to an expensive colour printer). Using the script with group policy will ensure that it will run when the user logs in.

    Note for BlueDevilFan: You may be able to "check all users from a central point without the user being logged in" if you could access their ntuser.dat files as the info will be in there (eg from a romaing profile, or a share to the pc istelf), but I agree that is would be much more work than it is worth. ;-)

    LVL 10

    Accepted Solution

    Current User Default printer can ba found with a script :
    Save it in a .vbs file.
    Or check this thread :

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" _
        & strComputer & "\root\cimv2")
    Set colInstalledPrinters =  objWMIService.ExecQuery _
        ("Select * from Win32_Printer Where Default = True")
    For Each objPrinter in colInstalledPrinters
        Wscript.Echo objPrinter.Name
    LVL 27

    Expert Comment

    by:Asta Cu
    Thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Product Review - Android Remix

    Come along for the ride with our Senior Product Manager, Brian Matis, as he reviews the Android Remix.

    NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
    This story has been written with permission from the scammed victim, a valued client of mine – identity protected by request.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    933 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now