PowerShell Question - File Exclusions

PowerShell script exchange

PowerShell Question - File Exclusions

Veeam Logoby danif » Mon Oct 17, 2016 6:42 am

Hi

Is there a possibility with Veeam PowerShell commands to import a list of "exclusions files" in the "VM Guest OS File Exclusion" function?

Thanks!
danif
Veeam Software
 
Posts: 3
Liked: never
Joined: Mon Feb 01, 2016 7:19 am
Full Name: Daniel Fehr

Re: PowerShell Question - File Exclusions

Veeam Logoby v.Eremin » Mon Oct 17, 2016 11:05 am

Just to clarify - you want to modify those settings or just output existing ones?

In the latter case, you can use this example and see whether it meets your expectations:

Code: Select all
asnp VEeamPssnapin
$Object = (Get-VBRJob -name "Name of your Job").GetObjectsInJob() | where {$_.name -eq "Name of your VM"}
$Object.VssOptions.GuestFSExcludeOptions.ExcludeList


Otherwise, you will have to modify the shown portion and then pass it to Set-VBRJobObjectVssOptions cmdlet.

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

Re: PowerShell Question - File Exclusions

Veeam Logoby danif » Mon Oct 17, 2016 1:15 pm

Hi Vladimir

Many thanks for the quick answer!

The hint with "Set-VBRJobObjectVssOptions" was very helpful, my script works now!

Regads,
Dani
danif
Veeam Software
 
Posts: 3
Liked: never
Joined: Mon Feb 01, 2016 7:19 am
Full Name: Daniel Fehr

Re: PowerShell Question - File Exclusions

Veeam Logoby v.Eremin » Mon Oct 17, 2016 1:26 pm

You're welcome.

Generally speaking, in PowerShell as is in GUI there are two levels of VSS related options: job and job object ones. They can be got and modified differently.

Job:

Code: Select all
Get-VBRJob
Get-VBRJobVSSOptions
Set-VBRJobVssOptions


Job Object:

Code: Select all
Get-VBRJobObject
Get-VBRJobObjectVssOptions
Set-VBRJobObjectVssOptions


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

Re: PowerShell Question - File Exclusions

Veeam Logoby PowerMike » Wed Nov 02, 2016 10:09 pm

Hello, I hope it's okay to post a question here in the reply section.

TSM in powershell does not seem to be accepting a command that works fine from a command window.

In command window

C:\Program Files\Tivoli\TSM\baclient>dsmc.exe q ba "G:\Backup\WRDB$PRA\*" -ina -subdir=y
-fromdate=10/31/2016 -todate=11/01/2016 -querysummary

The return is the answer to the query -- not included here

In Powershell
begin
{
$select = "q ba 'G:\Backup\WRDB$PRA\*' -ina -subdir=y -fromdate=10/31/2016 -todate=11/01/2016 -querysummary"
echo $select
& cd C:\Progra~1\Tivoli\TSM\baclient\
& C:\Progra~1\Tivoli\TSM\baclient\dsmc.exe "$select"
}

The return is

ANS1038S Invalid option specified.
ANS1820E Command line options must be preceded by a '-'

I have added a '-' but I then receive the message: ANS1107E Invalid option/value: '-Q'

Help please. And thanks
PowerMike
Lurker
 
Posts: 1
Liked: never
Joined: Wed Nov 02, 2016 9:50 pm
Full Name: Mike


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests