Export-VBRLogs

Short Description

Collects system logs for export.

Applies to

Platform: VMware, Hyper-V

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

Syntax

This cmdlet provides parameter sets that allow you to:

  • Collect logs for servers.

Export-VBRLogs -Server <CHost[]> -FolderPath <string> [-Compress] -LastDays <Int32>] [-Wait]  [<CommonParameters>]

  • Collect logs for jobs.

Export-VBRLogs -Job <IJob[]> -FolderPath <string> [-Compress] [-LastDays <Int32>] [-Wait]  [<CommonParameters>]

  • Collect logs for VMs.

Export-VBRLogs -Entity <IVmItem[]> -FolderPath <string> [-Compress] [-LastDays <Int32>] [-Wait]  [<CommonParameters>]

  • Collect logs for backups.

Export-VBRLogs -Backup <CBackup[]> -FolderPath <string> [-Compress] [-LastDays <Int32>] [-Wait]  [<CommonParameters>]

  • Collect logs for protected computers.

Export-VBRLogs -Computer <VBRDiscoveredComputer[]> -FolderPath <String> [-Compress] [-LastDays <Int32>] [-Wait]  [<CommonParameters>]

  • Collect logs for cloud tenants.

Export-VBRLogs -Tenant <VBRCloudTenant[]> -FolderPath <String> [-Compress] [-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

Parameter

Description

Type

Required

Position

Accept Pipeline Input

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-VBRServer сmdlet.

True

Named

True (ByValue,
ByProperty
Name)

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:

True

Named

True (ByValue,
ByProperty
Name)

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:

True

Named

True (ByValue,
ByProperty
Name)

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-VBRBackup cmdlet.

True

Named

True (ByValue,
ByProperty
Name)

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-VBRDiscoveredComputer cmdlet.

True

Named

True (ByValue,
ByProperty
Name)

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-VBRCloudTenant cmdlet.

True

Named

True (ByValue,
ByProperty
Name)

FolderPath

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

String

True

Named

False

Compress

Defines that the log files will be compressed.

Default: Enabled

SwitchParameter

False

Named

False

LastDays

Specifies the number of last days to collect the logs for.

Int32

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-VBRServer 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 enabled.

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

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

Perform the following steps:

  1. Run the Get-VBRSureBackupJob cmdlet. Specify the Name parameter value. Save the result to the $job variable.
  1. Run the Export-VBRLogs cmdlet. Set the $job variable as the Job parameter value. Specify the FolderPath parameter value.

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-VBRViEntity cmdlet. Specify the Name parameter value. Save the result to the $vm variable.
  1. 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-VBRBackup cmdlet. Specify the Name parameter value. Save the result to the $backup variable.
  1. 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-VBRDiscoveredComputer 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).

  1. 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.

Related Commands