Jump to content

Recommended Posts

Posted

Hopefully this is the right place for this...Wondering if anyone knows the best way to get a report of whats been printed from shared printers in the past month (username, page count etc), we are using a win 2008 r2 server as our print server.

 

Thanks

Posted

Managed this with PowerShell script as below: -

 

$aPrinterList = @()

 

$StartTime = "01/01/2016 12:00:00 PM"

$EndTime = "01/01/2016 6:00:00 PM"

$Results = Get-WinEvent -FilterHashTable @{LogName="Microsoft-Windows-PrintService/Operational"; ID=307; StartTime=$StartTime; EndTime=$EndTime;} -ComputerName "Print-Server"

 

 

ForEach($Result in $Results){

$ProperyData =

$Result.ToXml()

$PrinterName = $ProperyData.Event.UserData.DocumentPrinted.Param5

 

If($PrinterName.Contains("Printer Name")){

$hItemDetails = New-Object -TypeName psobject -Property @{

DocName = $ProperyData.Event.UserData.DocumentPrinted.Param2

UserName = $ProperyData.Event.UserData.DocumentPrinted.Param3

MachineName = $ProperyData.Event.UserData.DocumentPrinted.Param4

PrinterName = $PrinterName

PageCount = $ProperyData.Event.UserData.DocumentPrinted.Param8

TimeCreated = $Result.TimeCreated

}

 

$aPrinterList += $hItemDetails

}

}

 

#Output results to CSV file

$aPrinterList | Export-Csv -LiteralPath C:\Temp\PrintAudit.csv

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...