Script to document a backup job

PowerShell script exchange

Script to document a backup job

Veeam Logoby 20100 » Fri Mar 13, 2015 2:52 am

Hi

We need to document exactly how the backup are performed and we could not find any easy utility that provides a report, or file that describes the details of the process.
We looked at Powershell, but our knowledge is pretty limited, and the closest we got what that topic: powershell-f26/powershell-to-get-list-of-vm-s-in-a-veeam-backup-job-t3182.html but we could not get the list of VM.

Basically, we would be interested in a script that can list all the VM, and for each VM have the details for the following:
which disks are in the exceptions
Applications Aware Processing Options
Guest File System Indexing Options
Specific guest OS credential

Thanks in advance
20100
Enthusiast
 
Posts: 69
Liked: 5 times
Joined: Thu Feb 16, 2012 9:23 pm
Full Name: qq

Re: Script to document a backup job

Veeam Logoby v.Eremin » Fri Mar 13, 2015 9:02 am

Hi, Vincent,

Try the following example:

Code: Select all
$Job = Get-VBRJob -name "Name of your Job"
$Object = Get-VBRJobObject -Name "Name of VM" -Job $Job
$Object.DiskFilter #Disk info
$Object.VssOptions # AAIP options
$Object.VssOptions.WinGuestFSIndexingOptions #Win Guest Indexing Options
[Veeam.Backup.Core.CJobCredentials]::Find($Job.Id.Guid, $Object.id.Guid).CredentialsInfo.Credentials.UserName #Credentials name


I'm using quite complex way of getting name of credentials; sort of creative workaround. So, if someone finds less comprehensive way, let me know.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Script to document a backup job

Veeam Logoby 20100 » Mon Mar 16, 2015 1:18 am

Thanks Vladimir

the Disk info does not return the disks or the disk exceptions. Instead it displays the like of

Code: Select all
"Ver8|3000;3001;3002;3003;2000;2001;2002;2003;2004;2005;2006;2008;2009;2010;2011;2012;2013;2014;2015;2016;2017;2018;2019
;2020;2021;2022;2024;2025;2026;2027;2028;2029;2030;2031;2032;2033;2034;2035;2036;2037;2038;2040;2041;2042;2043;2044;204
5;2046;2047;2048;2049;2050;2051;2052;2053;2054;2056;2057;2058;2059;2060;2061;2062;2063;16000;16001;16002;16003;16004;16
005;16006;16008;16009;16010;16011;16012;16013;16014;16015;16016;16017;16018;16019;16020;16021;16022;16023;16024;16025;1
6026;16027;16028;16029;16030;16031;16032;16033;16034;16035;16036;16038;16039;16040;16041;16042;16043;16044;16045;16046;
16047;16048;16049;16050;16051;16052;16053;16054;16055;16056;16057;16058;16059;16060;16061;16062;16063;16064;16065;16066
;16068;16069;16070;16071;16072;16073;16074;16075;16076;16077;16078;16079;16080;16081;16082;16083;16084;16085;16086;1608
7;16088;16089;16090;16091;16092;16093;16094;16095;16096;16098;16099;16100;16101;16102;16103;16104;16105;16106;16107;161
08;16109;16110;16111;16112;16113;16114;16115;16116;16117;16118;16119"


Also, the script works if I hardcode the name of the Job (I am OK with that) and also the name of the VM: I would have preferred that the script displays all the VM automatically. At this stage, I would be happy to have just the information for the disks (or/and disk exceptions) ie disk0, disk1, etc and then I can add the options for indexing/credentials later on.

Thanks
20100
Enthusiast
 
Posts: 69
Liked: 5 times
Joined: Thu Feb 16, 2012 9:23 pm
Full Name: qq

Re: Script to document a backup job

Veeam Logoby v.Eremin » Mon Mar 16, 2015 10:39 am

the Disk info does not return the disks or the disk exceptions. Instead it displays the like of

In fact, it returns exclusions. The provided portion just suggests that there are no disk exclusions specified for a given object. You can add some check, using which you will filter this long string out.

Also, you can add a loop to the referenced script to make it work with all jobs and source objects:

Code: Select all
asnp VeeamPSSnapin
foreach ($Job in (Get-VBRJob | where {$_.Jobtype -eq "Backup" -and $_.TypeToString -eq "Vmware Backup"}))
{

foreach ($Object in Get-VBRJobObject -Job $Job)
{
if ($Object.DiskFilter -like "Ver8|3000;3001;3002;3003;2000;2001;2002;2003;2004;2005;2006;2008;2009;2010;2011;2012;2013;2014;2015;2016;2017;2018;2019;2020;2021;2022;2024;2025;2026;2027;2028;2029;2030;2031;2032;2033;2034;2035;2036;2037;2038;2040;2041;2042;2043;2044;2045;2046;2047;2048;2049;2050;2051;2052;2053;2054;2056;2057;2058;2059;2060;2061;2062;2063;16000;16001;16002;16003;16004;16005;16006;16008;16009;16010;16011;16012;16013;16014;16015;16016;16017;16018;16019;16020;16021;16022;16023;16024;16025;16026;16027;16028;16029;16030;16031;16032;16033;16034;16035;16036;16038;16039;16040;16041;16042;16043;16044;16045;16046;16047;16048;16049;16050;16051;16052;16053;16054;16055;16056;16057;16058;16059;16060;16061;16062;16063;16064;16065;16066;16068;16069;16070;16071;16072;16073;16074;16075;16076;16077;16078;16079;16080;16081;16082;16083;16084;16085;16086;16087;16088;16089;16090;16091;16092;16093;16094;16095;16096;16098;16099;16100;16101;16102;16103;16104;16105;16106;16107;16108;16109;16110;16111;16112;16113;16114;16115;16116;16117;16118;16119" -eq $True)
{
Write-Output $Object.name, "All disks"
}
Else
{
Write-Output $Object.name, $Object.diskfilter
}
}
}


Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Script to document a backup job

Veeam Logoby 20100 » Tue Mar 17, 2015 1:33 am

Thanks for this. It is what I was after.
20100
Enthusiast
 
Posts: 69
Liked: 5 times
Joined: Thu Feb 16, 2012 9:23 pm
Full Name: qq

Re: Script to document a backup job

Veeam Logoby v.Eremin » Tue Mar 17, 2015 9:49 am

You're welcome. Information regarding object AAIP settings can be also incorporated inside a loop, so that, you have it along with VM name and disk filter options.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests