Default Printer

(imported topic written by gbabbitt91)

I am looking for a way to pull the name of the default printer that is installed on a workstation.

I was able to use a wmi query to pull that info…

q: (if property "Default" of it as string contains "True" then property "Name" of it as string else nothing) of select objects ("Name, Default from win32_Printer") of wmi

This works ok and returns the value as “Name=PrinterName”

I was wanting to just pull the actual printer name (Not the “Name=”) but I was having trouble trying to parse that out. Anyone have any ideas on how to do that?

Also if there is a better way to accomplish this please let me know.

Thanks for the help.

Greg

(imported comment written by peterd91)

Hi Greg,

The below works well for me.

Q: (if property “Default” of it as string contains “True” then string value of property “Name” of it as string else nothing) of select objects (“Name, Default from win32_Printer”) of wmi

A: Microsoft XPS Document Writer

Cheers,

Peter

(imported comment written by gbabbitt91)

That works. Thanks Peter!

(imported comment written by tazmir91)

How can I find the name and total number # of printers installed on a Print server?.

(imported comment written by NoahSalzman)

It depends on the OS and print server software. On Windows 2003 you could gather the output from the command:

cscript prnmngr.vbs -l

http://technet.microsoft.com/en-us/library/cc772768(WS.10).aspx

(imported comment written by tazmir91)

in our environment, we have hundreds of print servers (all 2k3 sp2), is there a way to run this as an analysis property?.

(imported comment written by NoahSalzman)

You have to do the standard “BigFix Two-Step”: run an Action that writes out the results of “cscript prnmngr.vbs -l” to a file or the Registry or a Client Setting and then read the result in using an Analysis.