Check if  the option "print directly to printer"  is enabled

jskfan
jskfan used Ask the Experts™
on
Check if  the option "print directly to printer"  is enabled

I would like to have a script that reads computer names from a file and check if the default printer has the option "Print directly to printer" enabled.
the script below will  enable the option "print directly to printer" . if t can be modified to send query to see if the option has been enabled that would be great.

Thank you


FOR /f "delims=" %%G in (c:\Scripts\CompOnly.csv) DO wmic.exe /node:%%G /username:"Domain\User" /password:"TopSecret" printer where "Name='Myprinter'" set Direct=1

Timeout 5

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
Just remembered that /node supports a computer list as well ...
Try this:
wmic.exe /node:"@C:\Temp\CompOnly.csv" /username:"Domain\User" /password:"TopSecret" printer where "Name='Myprinter'" Get Name, Direct /format:csv >"C:\Temp\Direct.csv"
Timeout 5

Open in new window

NoahHardware Tester and Debugger

Commented:
Hi there! :)

Try something like this. Replace EPSON in between the two * with your printer name.

Get-Printer -Name *EPSON* | Get-PrintConfiguration

Open in new window

Author

Commented:
oBDA,

that script works fine it is retrieving all the printers on each computer . if you can query just the default printer on each computer.
Thank you
Most Valuable Expert 2018
Distinguished Expert 2018

Commented:
Can't be done, sorry. The default printer is a user specific setting, so the "computer" doesn't have a default printer.
You can only query by printer name like above.

Author

Commented:
it worked ...Thank you very much

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial