Tuesday, October 22, 2013

PowerShell Tip : Find Default Printer Installed using Powershell.

 

The job of System Administrators are very adventurous, sometime you have to find a little-little settings and sometime you have to write a big-big,  hundred’s of line’s scripts.

Today, my task was to find a default printer installed on laptops. To solve it , i used the Win32_Printer class.

You can run the below query on your laptop and this will show you the default installed  printer on your system.

To run the below command on the remote system you can –Computer parameter and make sure you are proper admin rights to access the system.

We are using Get-WmiObject cmdlet and then we are running a WQL query to select everything from Win32_Printer class and choose to show that result where default value is true.

Simple

Get-WmiObject -Query " SELECT * FROM Win32_Printer WHERE Default=$true"

21-10-2013 17-53-29

If you want to see all printers installed on your laptop, you can run the below code and this will show you the list of all printers,  with their Port Name and location.

Get-WmiObject -Query " SELECT * FROM Win32_Printer" | Select Name, Default, PortName,Location

21-10-2013 13-53-47

I love WMI .

Happy learning . ;o) .

Tested on : Windows7 [64 bit]

Thanks
Aman Dhally
clip_image001 clip_image002 clip_image003 clip_image005  clip_image007

4 comments:

  1. In a domain with some computers, is it possible to get all default printer with this PS command?
    Thanks

    ReplyDelete
  2. How to run this command for remote pc

    ReplyDelete
  3. Please share syntax to run these commands in domain

    ReplyDelete
  4. Hii
    Now and then, you may keep running into issues utilizing the printer when printing your pictures and archives. These difficulties can be settled by getting the assistance of specialized specialists.

    If any one know more about Hp Printer Visit To Technical Supports For Hp Printer | +1-855-517-2433


    If any one know more about Canon Printer Visit To Technical Supports For Canon Printers | +1-855-517-2433

    If any one know more about Canon Printing Problems and Solution Visit To Canon Printing Problems and Solution | +1-855-517-2433

    If any one know more about Brother Printers Visit To Technical Supports For Brother Printers | +1-855-517-2433

    If any one know more about Brother Printers Supports Visit To Brother Printer Support | +1-855-517-2433

    If any one know more about Computer Support Visit To Technical Supports For Computer Support | +1-855-517-2433


    Call Now +1-855-517-2433

    ReplyDelete