Get-SPOTenantLogEntry

Retrieves SharePoint Online company logs. This cmdlet is reserved for internal Microsoft use.

Syntax

Get-SPOTenantLogEntry
   [[-StartTimeInUtc] <DateTime>]
   [[-EndTimeInUtc] <DateTime>]
   [[-MaxRows] <UInt32>]
   -CorrelationId <Guid>
   [<CommonParameters>]
Get-SPOTenantLogEntry
   [[-StartTimeInUtc] <DateTime>]
   [[-EndTimeInUtc] <DateTime>]
   [[-MaxRows] <UInt32>]
   -Source <Int32>
   [<CommonParameters>]
Get-SPOTenantLogEntry
   [[-StartTimeInUtc] <DateTime>]
   [[-EndTimeInUtc] <DateTime>]
   [[-MaxRows] <UInt32>]
   -User <String>
   [<CommonParameters>]

Description

This cmdlet contains more than one parameter set. You may only use parameters from one parameter set and you may not combine parameters from different parameter sets. For more information about how to use parameter sets, see Cmdlet Parameter Sets.

The Get-SPOTenantLogEntry cmdlet cannot retrieve all SharePoint Online errors. This cmdlet retrieves a subset of errors that happen due to external systems.

For Beta 2, the only company logs available are for Business Connectivity Services (BCS).

Note

If you do not use any parameter, the first 1000 rows in descending time range are returned.

You must be at least a SharePoint Online administrator to run the cmdlet.

For permissions and the most current information about Windows PowerShell for SharePoint Online, see the online documentation at Intro to SharePoint Online Management Shell.

Examples

-----------------------EXAMPLE 1-----------------------------

Get-SPOTenantLogEntry

This example retrieves all logs that are available.

-----------------------EXAMPLE 2-----------------------------

Get-SPOTenantLogEntry -MaxRows 500

This example retrieves the first 500 log entries.

-----------------------EXAMPLE 3-----------------------------

$endTimeinUTC = Get-SPOTenantLogLastAvailableTimeInUtc
$startTimeinUTC = $endTimeinUTC.AddDays(-14)
$tenantlogs = Get-SPOTenantLogEntry -StartTimeinUtc $startTimeinUTC -EndTimeinUTC $endTimeinUTC

This example retrieves log entries recorded over that previous 14 days.

-----------------------EXAMPLE 4-----------------------------

$endTimeinUTC = Get-SPOTenantLogLastAvailableTimeInUtc
$startTimeinUTC = $endTimeinUTC.AddDays(-14)
$tenantlogs = Get-SPOTenantLogEntry -StartTimeinUtc $startTimeinUTC -EndTimeinUTC $endTimeinUTC -CorrelationId e2c2be70-6382-4ce7-8a44-ae7dadff5597

This example retrieves log entries recorded over that previous 14 days that have the CorrelationId of "e2c2be70-6382-4ce7-8a44-ae7dadff5597".

Parameters

-CorrelationId

Specifies the Correlation ID as a filter.

Type:Guid
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online

-EndTimeInUtc

Specifies the end time in UTC to search for logs.

Type:DateTime
Position:1
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online

-MaxRows

Specifies the maximum number of rows in the descending order of timestamp. The value must be less than 5000. The default value is 1000.

Type:UInt32
Position:2
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online

-Source

Specifies the component that logs the errors.

Type:Int32
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online

-StartTimeInUtc

Specifies the start time in Coordinated Universal Time (UTC) to search for the logs (for example, 01032011:12:00).

Type:DateTime
Position:0
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online

-User

Specifies the log-on identity as a filter.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online

Inputs

None

Outputs

System.Object