PowerShell script exchange
Post Reply
DUPER508
Lurker
Posts: 1
Liked: 2 times
Joined: Sep 11, 2015 10:20 pm
Full Name: Lance Kenley
Contact:

Dumping VBRJobObject settings to csv

Post by DUPER508 » 2 people like this post

Below is a sample script to dump VBR Job settings and object settings to CSV. You can always use the Get-Member cmdlet to see the the properties for each object. For example, Get-VBRJob | Get-Member. Then you can modify this script to get the properties that you want.

Code: Select all

$results = @()
$properties = @{JobName='';ObjectName='';Vss_Enabled=$false;Vss_IgnoreErrors=$false;Vss_IsCopyOnly=$false; SQL_BackupLogsEnabled=$false;SQL_BackupLogsFrequencyMin=0;SQL_ProxyAutoSelect=$false;SQL_RetainDays=0;SQL_TransactionLogsProcessing='';SQL_UseDbBackupRetention=$false}
Get-VBRJob | %{
$JobName = $_.name
Get-VBRJobObject -job $JobName} | %{
$ObjectName = $_.name
Get-VBRJobObjectVssOptions -ObjectInJob $_} | %{
$result = New-Object -TypeName PSObject -Property $properties;
$result.JobName = $JobName; 
$result.ObjectName = $ObjectName; 
$result.Vss_Enabled = $_.VssSnapshotOptions.Enabled;
$result.Vss_IgnoreErrors = $_.VssSnapshotOptions.IgnoreErrors;
$result.Vss_IsCopyOnly = $_.VssSnapshotOptions.IsCopyOnly;
$result.SQL_BackupLogsEnabled =$_.SqlBackupOptions.BackupLogsEnabled ;
$result.SQL_BackupLogsFrequencyMin = $_.SqlBackupOptions.BackupLogsFrequencyMin;
$result.SQL_ProxyAutoSelect = $_.SqlBackupOptions.ProxyAutoSelect;
$result.SQL_RetainDays = $_.SqlBackupOptions.RetainDays;
$result.SQL_TransactionLogsProcessing= $_.SqlBackupOptions.TransactionLogsProcessing;
$result.SQL_UseDbBackupRetention = $_.SqlBackupOptions.UseDbBackupRetention;
$results +=$result;
Write-host $result}

$results | export-csv c:\scripts\VBRjobobjects.csv
Dima P.
Product Manager
Posts: 14715
Liked: 1702 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Dumping VBRJobObject settings to csv

Post by Dima P. »

Hello and welcome to the community!

Thanks for sharing such a useful script it’s highly appreciated and worth testing for sure. Cheers.
Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests