Export-VBOLog

In this article

    Short Description

    Exports log data.

    Syntax

    This cmdlet provides the following parameter sets:

    • Export all collected logs.

    Export-VBOLog -ServerComponent <VBOServerComponent[]> -All  -TargetPath <String>  [<CommonParameters>]

    • Export logs for a specified time period.

    Export-VBOLog -ServerComponent <VBOServerComponent[]> -TargetPath <String> [-From <DateTime>] [-To <DateTime>]  [<CommonParameters>]

    • Export logs collected for a specified amount of days.

    Export-VBOLog -ServerComponent <VBOServerComponent[]> -DayPeriod <int> -TargetPath <string>  [<CommonParameters>]

    Detailed Description

    This cmdlet exports logs of a specified server component.

    Parameters

    Parameter

    Description

    Type

    Required

    Position

    Accept Pipeline Input

    ServerComponent

    Specifies an array of server components. This cmdlet will export logs of the specified server component.

    Accepts the VBOServerComponent[] object. To get this object, run the Get-VBOServerComponents cmdlet.

    True

    Named

    False

    All

    Indicates that this cmdlet will export logs for all time. You cannot use From, To and DayPeriod parameters if this parameter is used.

    SwitchParameter

    True

    Named

    False

    TargetPath

    Specifies a target path for the log export. This cmdlet will export logs to this destination.

    String

    True

    Named

    False

    DayPeriod

    Specifies the number of last N days. The cmdlet will export logs for these days.

    Permitted values:  1–999.

    Note: You cannot use the All, From and To parameters if this parameter is used.

    Int

    True

    Named

    False

    From

    Specifies date and time, starting from which this cmdlet will export the logs. If this parameter is used, you must use To parameter and you cannot use All and DayPeriod parameters. You must enter date and time in a DateTime format.

    DateTime

    False

    Named

    False

    To

    Specifies the date and time, until which this cmdlet will export the logs. If this parameter is used, you must use From parameter and you cannot use All and DayPeriod parameters. You must enter date and time in a DateTime format.

    DateTime

    False

    Named

    False

    <CommonParameters>

    This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.

    Output Object

    None.

    Examples

    Export-VBOLogExample 1. Exporting all Logs Collected for Backup Proxy Server

    This example shows how to export all logs collected for a backup proxy server. The cmdlet will export logs with the following settings:

    • Logs will be exported for a backup proxy with the 06b7354e-518f-4a10-b4c1-98f49d743012 ID.
    • The cmdlet will export logs to the C:\Veeam\Office365\Logs folder.

    $proxy = Get-VBOServerComponents -Name Proxy -Id 06b7354e-518f-4a10-b4c1-98f49d743012

    Export-VBOLog -ServerComponent $proxy -TargetPath "C:\Veeam\Office365\Logs" -All

    Perform the following steps:

    1. Run the Get-VBOServerComponents cmdlet. Specify the Name parameter value. Specify the Id parameter value. Save the result to the $proxy variable.
    2. Run the Export-VBOLog cmdlet. Set the $proxy variable as the ServerComponent parameter value. Specify the TargetPath parameter value. Provide the All parameter.

    Export-VBOLogExample 2. Exporting Logs For Backup Proxy Server for Specific Period

    This example shows how to export logs for a backup proxy server for a specific period. The cmdlet will export logs with the following settings:

    • Logs will be exported for a backup proxy with the 06b7354e-518f-4a10-b4c1-98f49d743012 ID.
    • The export period of logs is set from 08/29/2017 10:00 AM to 11/15/2017 10:00 AM.
    • The cmdlet will export logs to the C:\Veeam\Office365\Logs folder.

    $proxy = Get-VBOServerComponents -Name proxy -Id 06b7354e-518f-4a10-b4c1-98f49d743012

    $datefrom = [datetime]"08/29/2017 10:00 AM"

    $dateto = [datetime]"11/15/2017 10:00 AM"

    Export-VBOLog -ServerComponent $proxy -From $datefrom -To $dateto -TargetPath "C:\Veeam\Office365\Logs"

    Perform the following steps:

    1. Run the Get-VBOServerComponents cmdlet. Specify the Name parameter value. Specify the Id parameter value. Save the result to the $proxy variable.
    2. Set the start date of the export period in the $datefrom variable and cast the date string to the datetime type.
    3. Set the end date of the export period in the $dateto variable and cast the date string to the datetime type.
    4. Run the Export-VBOLog cmdlet. Specify the following settings:
    • Set the $proxy variable as the ServerComponent parameter value.
    • Set the $datefrom variable as the From parameter value.
    • Set the $dateto parameter as the To parameter value.
    • Specify the TargetPath parameter value.

    Related Commands

    Get-VBOServerComponents