locked
Find network printer configuration remotely RRS feed

  • Question

  • Hi all,

    I am new to this forum,  I hope someone would help with this,  I am looking for vb script which helps me to get the printers  with specific configuration, I want to list all the printe queues in our environment with attribute set to "keep printed documents" true.  

    I found the prncnfg.vbs script in C:\Windows\System32\Printing_Admin_Scripts\en-US, on W2K8 R2 server,  this script is available on all windows OS stored in different paths. through this script I am able to fetch the information. by running this command {c:\Cscript prncnfg.vbs -g -s (servername) -P (printername)} {I copied the script to c drive from default windows path before executing this command},  the out put would list if the print queue is set to that attribute along with other info.

    But I need to know only if the attribute " keep printed documents" is true or false for all the printers on one print servers.
    and also I have all the servers list with me,  so is it possible to get the results in one go. 



    dibu

    Tuesday, July 8, 2014 5:57 AM

Answers

  • This does exactly what you want:

    get-printer | ?{$_.KeepPrinterDocuments}

    HELP Get-Printer -full


    ¯\_(ツ)_/¯

    • Marked as answer by dhanpal mcp Wednesday, July 9, 2014 8:06 AM
    Tuesday, July 8, 2014 12:59 PM
  • You can also use this from anywhere in the network

    Get-WmiObject Win32_Printer -filter 'KeepPrintedJobs=True' -ComputerName <myserver>


    ¯\_(ツ)_/¯

    • Marked as answer by dhanpal mcp Wednesday, July 9, 2014 5:43 AM
    Tuesday, July 8, 2014 1:03 PM

All replies

  • This does exactly what you want:

    get-printer | ?{$_.KeepPrinterDocuments}

    HELP Get-Printer -full


    ¯\_(ツ)_/¯

    • Marked as answer by dhanpal mcp Wednesday, July 9, 2014 8:06 AM
    Tuesday, July 8, 2014 12:59 PM
  • You can also use this from anywhere in the network

    Get-WmiObject Win32_Printer -filter 'KeepPrintedJobs=True' -ComputerName <myserver>


    ¯\_(ツ)_/¯

    • Marked as answer by dhanpal mcp Wednesday, July 9, 2014 5:43 AM
    Tuesday, July 8, 2014 1:03 PM
  • Thank you for the reply,   this helped me a lot, 

    Also I would like to know,  I have a list of print servers IP addresses in a .txt file,  so how can I get the script to read the server names from that servers.txt files,  and the output should be to a results.txt file with server name and only print queue names for which the attribute ('KeepPrintedJobs=True' ) is enabled.


    dibu

    Wednesday, July 9, 2014 8:06 AM
  • Just read the file using Get-Content.

    Start here: http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx


    ¯\_(ツ)_/¯

    Wednesday, July 9, 2014 9:02 AM
  • Thanks a lot again for your help.  much appreciated.

    dibu

    Wednesday, July 9, 2014 1:07 PM