Forum Discussion

Jared's avatar
8 months ago

Print Spooler

Has anyone been able to get a non-cluster print spooler to work? I’m trying to list out the printers connected to the print spooler so I don’t have to manually maintain an individual printer list and have been unable to get custom scripting to work by adjusting the cluster code. Let me know if anyone has a better way to do this.

  • Anonymous's avatar
    Anonymous

    OS? Windows? Have you tried the Win32_Printer WMI class?

  • @Stuart Weenig yes sir, I tried replacing Win32_printer WMI class in the cluster script, then running it thru chatgpt. I also then had to change the property source so that it was for the regular print servers, but alas, I don’t know enough about scripting to actually troubleshoot it. I just go by what chatgpt tells me and it started saying that the server wouldn’t allow the request, but WMI is working fine and the datasource for errors seems to be working. I don t know. It is windows 2019

  • Anonymous's avatar
    Anonymous

    Probably time to take the GPT training wheels off and learn some coding. 

    Or see if you can use the no-code WMI datasource type since you know the class. Unfortunately, LM has documented ESX, JDBC, JMX, NetApp, SNMP, HTTP/S, Batch, and Script methods, but i can’t find the WMI datasource collector documentation.

    You could start by executing the !wmi command on the collector monitoring that resource using the collector debug console. Executing it without any arguments will give you the syntax. Then you can fill in the hostname and class you want to query. Knowing what the WMI query returns will be a big step towards getting your DS written.

    Then you’ll need to think about active discovery and collection, finalizing what AD will mostly look like before you move onto collection.

  • Powershell command for this is: get-printer

    so you can run an active discovery script that outputs:
    (get-printer).name

  • Still no editing of posts... the get-printer will need to use a -cimsession to get to the remote system from the collector.  you can technically use -computername, but that makes an interactive login with a profile load to perform the task and can lead to profile issues.  The typical structure is:
    # Build session

    # Retreive remote data through the session

    # Remove session