Identify printer usage statistics in a certain server?

EnterpriseArchitect 5,666 Reputation points
2023-07-18T08:39:40.72+00:00

As part of the due diligence process, I need evidence or a way of identifying printer usage without causing a massive outage.

I can see some network printers shared and available when I browse some of the servers in my domain using \Server1. 

Is it possible to determine whether a printer has been shared from a server but it is still in use?

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,875 questions
Windows Server Printing
Windows Server Printing
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Printing: Printer centralized deployment and management, scan and fax resources management, and document services
698 questions
Windows Server Security
Windows Server Security
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
1,902 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,625 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,808 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Kev Kelly 180 Reputation points
    2023-07-18T13:32:21.5833333+00:00

    Event ID 307 displays information about the jobs printed.

    The following PowerShell should get you started (although note I'm not in front of my environment to test) with being able to query those events, and return the printer names:

    $printLog = Get-WinEvent -FilterHashTable @{LogName='Microsoft-Windows-PrintService/Operational'; ID=307;}
    
    $printers = $printLog | ForEach-Object {
        $propertyData = [xml]$_.ToXml()
        $printerName = $propertyData.Event.UserData.DocumentPrinted.Param5
        $printerName
    } | Select-Object -Unique
    
    Write-Host "Printers Used:"
    $printers | ForEach-Object {
        Write-Host $_
    }
    
    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.