Get-WebSitesEvent

Get-WebSitesEvent

Gets events from the event log.

Syntax

Parameter Set: ServerFilter
Get-WebSitesEvent [[-ComputerName] <String> ] [-EndTime <DateTime> ] [-PipelineVariable <String> ] [-StartTime <DateTime> ] [ <CommonParameters>]


 

Detailed Description

The Get-WebSitesEvent gets events from the event log. Specifiy the computer by using the ComputerName parameter and the time range by using the StartTime and EndTime parameters.

Parameters

-ComputerName<String>

Specifies the computer to query.

 

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

 

-EndTime<DateTime>

Specifies the end time for queries. To get a datetime object, use the Get-Date cmdlet.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

 

-PipelineVariable<String>

Specifies a variable to be used with the pipeline operator.

 

Aliases

pv

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-StartTime<DateTime>

Specifies the start time for queries. To get a datetime object, use the Get-Date cmdlet.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

 

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Examples

Example 1: Get all events.

This command gets all events for all times across all of the servers in the farm.

PS C:\> Get-WebSitesEvent

 

Example 2: Get all events for a specific server

This command gets all events for all times for Server01.

PS C:\> Get-WebSitesEvent -ServerName "Server01"

 

Example 3: Get all events for a specific timeframe

This command gets all events in the specified timeframe for all of the servers in the farm.

PS C:\> Get-WebSitesEvent -StartTime '7/25/2013 10:57:10 PM' -EndTime '7/25/2013 10:57:12 PM'

 

Example 4: Get all events for a specific server for a specific timeframe

This command gets all events for the specified timeframe for Server01.

PS C:\> Get-WebSitesEvent -StartTime '7/25/2013 10:57:10 PM' -EndTime '7/25/2013 10:57:12 PM' -ServerName "Server01"