Share via


Export-DebugLogs

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

Syntax

Default (Default)

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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:PSCredential
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

System.Object