Share via


Export-DebugLogs

Gathers and exports Microsoft Purview Information Protection client and scanner log files to a compressed file.

Syntax

Export-DebugLogs
      [-FileName] <String>
      [-OnBehalfOf <PSCredential>]
      [<CommonParameters>]

Description

The Export-DebugLogs cmdlet gathers all client and scanner log files from %localappdata%\Microsoft\MSIP\Logs and saves them to a single, compressed file that has a .zip format. This file can then be sent to Microsoft Support if you are requested to send log files to help investigate a reported issue with the Microsoft Purview Information Protection client or scanner from this client.

Use the OnBehalfOf parameter if you need to export log files from a service account. For example, an account that has been created to run non-interactively, such as the account for the MicrosoftPurview Information Protection scanner.

Examples

Example 1

PS C:\> Export-DebugLogs -FileName C:\Logs\AIPLogs.zip

This command gathers and saves all exported logs to the AIPLogs.zip file in the existing C:\Logs folder.

Parameters

-FileName

The path and file name for the exported log files.

The path can be local or a network path (mapped drive letter or UNC).

Any folders in the path must already exist. If you specify a file name that already exists in the specified folder, the original file is overwritten.

When you specify the file name, include the .zip file name extension.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOf

To use this parameter, you must run your PowerShell session with the Run as Administrator option.

Specifies the variable that includes the credentials object to use when you need to export log files from an account other than the account you are currently signed in with. For example, you need to collect log files for the service account that runs the Microsoft Purview Information Protection scanner. In this scenario, if the scanner is installed on the same computer as you're running this cmdlet, the log files also include some information from the scanner's configuration database.

Use the Get-Credentials cmdlet to create the variable that stores the credentials.

Type:PSCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

System.Object

Notes