< Back

Get-PrintDocumentEvent

Sat Jan 18, 2020 8:17 pm

NAME Get-PrintDocumentEvent



SYNOPSIS

This function will show you details for the successful print jobs that the system has processed.





SYNTAX

Get-PrintDocumentEvent [[-ComputerName] <String>] [[-Credential] <PSCredential>] [[-StartTime] <DateTime>]

[[-EndTime] <DateTime>] [[-MaxEvents] <Int64>] [-Oldest] [-ClientMachineName <String>] [-PrinterName <String>]

[-PrinterPort <String>] [-Raw] [-UserName <String>] [<CommonParameters>]





DESCRIPTION

This function will show you details for the successful print jobs that the system has processed.





PARAMETERS

-ComputerName <String>

Gets events from the event logs on the specified computer. Type the NetBIOS name, an Internet Protocol (IP)

address, or the fully qualified domain name of the computer. The default value is the local computer.



Required? false

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName, ByValue)

Accept wildcard characters? false



-Credential <PSCredential>

Specifies a user account that has permission to perform this action. The default value is the current user.



Type a user name, such as User01 or Domain01\\User01. Or, enter a PSCredential object, such as one generated by

the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. If you type only the

parameter name, you will be prompted for both a user name and a password.



Required? false

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-EndTime <DateTime>

Specifies the end of the time period for the event log query.



Required? false

Position? 3

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-MaxEvents <Int64>

Specifies the maximum number of events this function returns. Enter an integer. The default is to return all

the events in the logs.



Required? false

Position? 4

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Oldest [<SwitchParameter>]

Returns the events in oldest-first order. By default, events are returned in newest-first order.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-StartTime <DateTime>

Specifies the beginning of the time period for the event log query.



Required? false

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ClientMachineName <String>

Filter by the client machine host name.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PrinterName <String>

Filter events for the specified printer.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PrinterPort <String>

Filter events for the specified printer port name, e.g. IP_172.16.5.27



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Raw [<SwitchParameter>]

Use this switch to provide the raw event log record for the function.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-UserName <String>

Filter the results by the user which printed documents. Provide the SamAccountName only.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String







OUTPUTS

System.Object







NOTES









-------------------------- Example 1 --------------------------



PS C:\\> C:\\PowerShell\\Get-PrintDocumentEvent -ComputerName printsvc -MaxEvents 1 -Oldest



ComputerName : PRINTSVR

TimeCreated : 10/5/2017 8:12:05 AM

PrintJobId : 234

DocumentName : Print Document

UserName : CONTOSO\\KSmith2

ClientMachineName : WKSTN07

PrinterName : HPColorPrinter

PrinterPort : IP_172.16.5.37

DocumentSizeBytes : 1557928

DocumentPageCount : 2







RELATED LINKS

Online Version: https://powershell.anovelidea.org/modul ... Event.html