PowerShell script exchange
Post Reply
danif
Novice
Posts: 4
Liked: never
Joined: Feb 01, 2016 7:19 am
Full Name: Daniel Fehr
Contact:

PowerShell Question - File Exclusions

Post by danif »

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!
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: PowerShell Question - File Exclusions

Post by veremin »

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.
danif
Novice
Posts: 4
Liked: never
Joined: Feb 01, 2016 7:19 am
Full Name: Daniel Fehr
Contact:

Re: PowerShell Question - File Exclusions

Post by danif »

Hi Vladimir

Many thanks for the quick answer!

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

Regads,
Dani
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: PowerShell Question - File Exclusions

Post by veremin »

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.
PowerMike
Lurker
Posts: 1
Liked: never
Joined: Nov 02, 2016 9:50 pm
Full Name: Mike
Contact:

Re: PowerShell Question - File Exclusions

Post by PowerMike »

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
Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests