Export-VBRLogs

Short Description

Collects system logs for export.

Platform: VMware, Hyper-V

Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License

Syntax

This cmdlet provides the following parameter sets:

  • Server

    Export-VBRLogs -Server <CHost[]> -FolderPath <String> [-Compress] [-From <DateTime>] [-To <DateTime>] [-Wait]

    [-LastDays <Int32>] [<CommonParameters>]

  • Job

    Export-VBRLogs -Job <IJob[]> -FolderPath <String> [-Compress] [-From <DateTime>] [-To <DateTime>] [-Wait]

    [-LastDays <Int32>] [<CommonParameters>]

  • Entity

    Export-VBRLogs -Entity <IVmItem[]> -FolderPath <String> [-Compress] [-From <DateTime>] [-To <DateTime>] [-Wait]

    [-LastDays <Int32>] [<CommonParameters>]

  • Backup

    Export-VBRLogs -Backup <CBackup[]> -FolderPath <String> [-Compress] [-From <DateTime>] [-To <DateTime>] [-Wait]

    [-LastDays <Int32>] [<CommonParameters>]

  • DiscoveredComputer

    Export-VBRLogs -Computer <VBRDiscoveredComputer[]> -FolderPath <String> [-Compress] [-From <DateTime>]

    [-To <DateTime>] [-Wait] [-LastDays <Int32>] [<CommonParameters>]

  • Tenant

    Export-VBRLogs -Tenant <IVBRCloudTenant[]> -FolderPath <String> [-Compress] [-From <DateTime>] [-To <DateTime>]

    [-Wait] [-LastDays <Int32>] [<CommonParameters>]

  • ScaleOutRepository

    Export-VBRLogs -ScaleOutRepository <CExtendableRepository[]> -FolderPath <String> [-Compress]

    [-From <DateTime>] [-To <DateTime>] [-Wait] [-LastDays <Int32>] [<CommonParameters>]

Detailed Description

This cmdlet collects system logs. The log files are written to the folder you specify in this cmdlet.

You can use this cmdlet to collect logs you can send to the Veeam support.

You can get logs for all kind of virtual host, any jobs including SureBackup jobs, entities including VMware or Hyper-V VMs, or any backup. Use an appropriate parameter set for each case.

Parameters

Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

Backup

Specifies an array of backups. The cmdlet will collect logs of these backups.

Accepts the CBackup[] object. To get this object, run the Get-VBRBackupReturns backups. cmdlet.

CBackup[]

True

Named

True (ByPropertyName, ByValue)

Compress

Defines that the log files will be compressed.

Default: True.

Note: To disable this option, set the parameter value to $false. That is, parameter_name:$false.

SwitchParameter

False

Named

False

Computer

Specifies an array of protected computers. The cmdlet will collect logs of these computers.

Accepts the VBRDiscoveredComputer[] object. To get this object, run the Get-VBRDiscoveredComputerReturns discovered computers. cmdlet.

VBRDiscoveredComputer[]

True

Named

True (ByPropertyName, ByValue)

Entity

Specifies an array of VMs. The cmdlet will collect logs of these VMs.

Accepts the IVmItem[] object. To get this object, run one of the following cmdlets:

IVmItem[]

True

Named

True (ByPropertyName, ByValue)

FolderPath

Specifies the destination folder. The cmdlet will export logs to this folder.

String

True

Named

False

From

Specifies the start date to collect the logs for export. Enter the date in format set in your workstation Date and Time settings. Note: This parameter is deprecated and will be marked as obsolete in the future. You must re-write your scripts by using the LastDays parameter. Otherwise, the script will return an error.

DateTime

False

Named

False

Job

Specifies an array of jobs. The cmdlet will collect logs of these jobs.

Accepts all kinds of jobs.

Accepts the IJob[] object. To get this object, run one of the following cmdlets:

IJob[]

True

Named

True (ByPropertyName, ByValue)

LastDays

Specifies the number of days for which to collect logs. If you do not specify this parameter, Veeam Backup & Replication will collect logs for the last 1 day.

Int32

False

Named

False

ScaleOutRepository

Specifies an array of scale-out backup repositories. The cmdlet will collect logs of these repositories.

Accepts the CExtendableRepository[]object. To get this object, run the Get-VBRScaleOutBackupRepository cmdlets:

CExtendableRepository[]

True

Named

True (ByPropertyName, ByValue)

Server

Specifies an array of servers. The cmdlet will collect logs from these servers.

Note: The selected servers must be running and available over the network.

Accepts the CHost[] object. To create this object, run the Get-VBRServerReturns hosts connected to the backup infrastructure. cmdlet.

CHost[]

True

Named

True (ByPropertyName, ByValue)

Tenant

Specifies an array of cloud tenants. The cmdlet will collect logs of these cloud tenants.

Note: This parameter does not return logs of VMware Cloud Director and Active Directory tenant accounts.

Accepts the VBRCloudTenant[] object. To get this object, run the Get-VBRCloudTenantReturns cloud tenant accounts. cmdlet.

IVBRCloudTenant[]

True

Named

True (ByPropertyName, ByValue)

To

Specifies the end date to collect the logs for export. Enter the date in format set in your workstation Date and Time settings. Note: This parameter is deprecated and will be marked as obsolete in the future. You must re-write your scripts by using the LastDays parameter. Otherwise, the script will return an error.

DateTime

False

Named

False

Wait

Defines that the command waits for the process to complete before accepting more input.

SwitchParameter

False

Named

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see Microsoft Docs.

Output Object

The cmdlet returns the VBRLogs object that contains system logs.

Examples

Export-VBRLogsExample 1. Collecting Logs for Servers

This example shows how to collect log files from the Active_Directory server with the following settings:

  • The destination path is C:\Logs.
  • The period for collecting data is last 7 days.
  • The logs compression is enabled.

$server = Get-VBRServer -Name "Active_Directory"

Export-VBRLogs -Server $server -FolderPath "C:\Logs" -LastDays 7

Perform the following steps:

  1. Run the Get-VBRServerReturns hosts connected to the backup infrastructure. cmdlet. Specify the Name parameter value. Save the result to the $server variable.
  2. Run the Export-VBRLogs cmdlet. Specify the following settings:
    • Set the $server variable as the Server parameter value.
    • Specify the FolderPath parameter value.
    • Specify the LastDays parameter value.

Export-VBRLogsExample 2. Collecting Logs for Jobs

This example shows how to collect log files for the DC SureJob SureBackup job with the following settings:

  • The destination path is C:\Logs\SureBackup Logs.
  • The period for collecting data is not set to collect all the data for the job.
  • The logs compression is disabled.

$job = Get-VBRSureBackupJob -Name "DC SureJob"

Export-VBRLogs -Job $job -FolderPath "C:\Logs\SureBackup Logs" -Compress:$false

Perform the following steps:

  1. Run the Get-VBRSureBackupJobReturns SureBackup jobs. cmdlet. Specify the Name parameter value. Save the result to the $job variable.
  2. Run the Export-VBRLogs cmdlet. Set the $job variable as the Job parameter value. Specify the FolderPath parameter value. Set the Compress parameter to $false.

Export-VBRLogsExample 3. Collecting Logs for VM

This example shows how to collect log files for the DC VM with the following settings:

  • The destination path is C:\Logs.
  • The period for collecting data is last 30 days.
  • The logs compression is enabled.

$vm = Find-VBRViEntity -Name "DC"

Export-VBRLogs -Entity $vm -FolderPath "C:\Logs" -LastDays 30

Perform the following steps:

  1. Run the Find-VBRViEntityLooks for VMware objects. cmdlet. Specify the Name parameter value. Save the result to the $vm variable.
  2. Run the Export-VBRLogs cmdlet. Specify the following settings:
    • Set the $vm variable as the Entity parameter value.
    • Specify the FolderPath parameter value.
    • Specify the LastDays parameter value.

Export-VBRLogsExample 4. Collecting Logs for Backups

This example shows how to collect log files for the srv2049-job backup with the following settings:

  • The destination path is C:\Logs.
  • The period for collecting data is last 14 days.
  • The logs compression is enabled.

$backup = Get-VBRBackup -Name "srv2049-job"

Export-VBRLogs -CBackup $backup -FolderPath "C:\Logs" -LastDays 14

Perform the following steps:

  1. Run the Get-VBRBackupReturns backups. cmdlet. Specify the Name parameter value. Save the result to the $backup variable.
  2. Run the Export-VBRLogs cmdlet. Specify the following settings:
    • Set the $backup variable as the CBackup parameter value.
    • Specify the FolderPath parameter value.
    • Specify the LastDays parameter value.

Export-VBRLogsExample 5. Collecting Logs for Protected Computers

This example shows how to collect log files for protected computers with the following settings:

  • The destination path is C:\Logs.
  • The period for collecting data is last 10 days.
  • The logs compression is enabled.

$machines = Get-VBRDiscoveredComputer -Type Computer

Export-VBRLogs -Computer $machines[3] -FolderPath "C:\Logs" -LastDays 10

Perform the following steps:

  1. Run the Get-VBRDiscoveredComputerReturns discovered computers. cmdlet. Set the Computer option for the Type parameter. Save the result to the $machines variable.

    The Get-VBRDiscoveredComputer cmdlet will return an array of protected computers. Mind the ordinal number of the necessary protected computer (in our example, it is the fourth computer in the array).

  2. Run the Export-VBRLogs cmdlet. Specify the following settings:
    • Set the $machines[3] variable as the Computer parameter value.
    • Specify the FolderPath parameter value.
    • Specify the LastDays parameter value.

Page updated 2026-08-19

Page content applies to build 13.1.1.18