Get-PrintDocumentEvent¶
SYNOPSIS¶
This function will show you details for the successful print jobs that the system has processed.
SYNTAX¶
TimeSpan (Default)¶
Get-PrintDocumentEvent [[-ComputerName] <String>] [[-Credential] <PSCredential>] [-Since <TimeSpan>] [[-MaxEvents] <Int64>] [-Oldest] [-Raw] [-UserName <String>] [-ClientMachineName <String>] [-PrinterName <String>] [-PrinterPort <String>] [-DocumentName <String>] [-PagesPrinted <String>] [<CommonParameters>]
TimeRange¶
Get-PrintDocumentEvent [[-ComputerName] <String>] [[-Credential] <PSCredential>] [[-StartTime] <DateTime>] [[-EndTime] <DateTime>] [[-MaxEvents] <Int64>] [-Oldest] [-Raw] [-UserName <String>] [-ClientMachineName <String>] [-PrinterName <String>] [-PrinterPort <String>] [-DocumentName <String>] [-PagesPrinted <String>] [<CommonParameters>]
DESCRIPTION¶
This function will show you details for the successful print jobs that the system has processed.
EXAMPLES¶
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
PARAMETERS¶
-ComputerName¶
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.
Type: String Parameter Sets: (All) Aliases: IPAddress, __Server, CN Required: False Position: 0 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False
-Credential¶
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.
Type: PSCredential Parameter Sets: (All) Aliases: Required: False Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False
-EndTime¶
Specifies the end of the time period for the event log query.
Type: DateTime Parameter Sets: TimeRange Aliases: Required: False Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False
-MaxEvents¶
Specifies the maximum number of events this function returns. The default is to return all the events in the logs.
Type: Int64 Parameter Sets: (All) Aliases: Required: False Position: 4 Default value: None Accept pipeline input: False Accept wildcard characters: False
-Oldest¶
Returns the events in oldest-first order. By default, events are returned in newest-first order.
Type: SwitchParameter Parameter Sets: (All) Aliases: Required: False Position: Named Default value: False Accept pipeline input: False Accept wildcard characters: False
-StartTime¶
Specifies the beginning of the time period for the event log query.
Type: DateTime Parameter Sets: TimeRange Aliases: Required: False Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False
-ClientMachineName¶
Filter by the client machine host name.
Type: String Parameter Sets: (All) Aliases: Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False
-PrinterName¶
Filter events for the specified printer.
Type: String Parameter Sets: (All) Aliases: Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False
-PrinterPort¶
Filter events for the specified printer port name, e.g. IP_172.16.5.27
Type: String Parameter Sets: (All) Aliases: Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False
-Raw¶
Use this switch to provide the raw event log record for the function.
Type: SwitchParameter Parameter Sets: (All) Aliases: Required: False Position: Named Default value: False Accept pipeline input: False Accept wildcard characters: False
-UserName¶
Filter the results by the user which printed documents. Provide the SamAccountName only.
Type: String Parameter Sets: (All) Aliases: Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False
-DocumentName¶
Filter the results by the name of the printed document.
Type: String Parameter Sets: (All) Aliases: Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False
-PagesPrinted¶
Filter the results by the number of pages printed.
Type: Integer Parameter Sets: (All) Aliases: Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False
-Since¶
Specifies the beginning of the time period for the event log query based on the given amount of time.
Type: TimeSpan Parameter Sets: TimeSpan Aliases: Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False
CommonParameters¶
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.