PowerShell script exchange
Post Reply
Nico_GK
Lurker
Posts: 2
Liked: never
Joined: Jan 02, 2025 2:02 pm
Full Name: Nico R
Contact:

Adding SMB source as 'directory' instead of 'Host'

Post by Nico_GK »

Hi and happy new year,

I have a NAS_To_Tape job to backup NetApp Fileshares to Tape.
When I edit the job in the GUI, after selecting the SMB host(NetApp SVM), I can select all SMB shares and add them as a source.
Since there are more than 100 shares and they keep changing, I would like to automate this.
Problem, the objects are created with the Veeam Powershell as “Host” and not as “Directory”.

For example:
After adding source in GUI

Code: Select all

(Get-VBRTapeJob -name "NAS_Test").object

IncludeMask   : *.*
ExcludeMask   : 
Path          : \\filer\share
SelectionType : Directory
Server        : \\fileserver(ID)
I use this script for adding the SMB shares to Job

Code: Select all

$NASServer = Get-VBRUnstructuredServer -ID <ID>
$Job = Get-VBRTapeJob -Name 'NAS_Test'
$Volumes = @(Get-ChildItem -Path '\\fileserver\c$' )
$NASVolumes = @()
    foreach ($vol in $Volumes){
    $volname = $vol.name
    $volpath = '\\fileserver\c$\' + $volname
    $NASVolumes += New-VBRFileToTapeObject -IncludeMask "*.*" -ExcludeMask "*.snapshot;~snapshot" -Path $volpath -NASServer $NASServer 
    }
Set-VBRFileToTapeJob -Job $Job -Object $NASVolumes
Afterwards I get following:

Code: Select all

(Get-VBRTapeJob -name "NAS_Test").object

IncludeMask   : *.*
ExcludeMask   : 
Path          : \\filer\share
SelectionType : Host
Server        : \\fileserver(ID)
So my problem is, that with using the Powershell-Command 'New-VBRFileToTapeObject', I can't find a way to get the property 'SelectionType' as Directory.
Does anyone else have this problem or could I solve it in another way?

Many thanks
david.domask
Veeam Software
Posts: 2622
Liked: 611 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Adding SMB source as 'directory' instead of 'Host'

Post by david.domask »

Hi Nico_GK, welcome to the forums.

First, a practical question -- does the job not work when adding it this way? Mostly just a curiosity so you can get your backups going.

I tried to reproduce on Veeam Backup and Replication 12.3 with a freshly added SMB share and a fresh File to Tape job, but I could not reproduce, it showed as directory as expected both from UI and Powershell.

I would ask if you could reproduce the issue, note the date/time of the test (and the relevant job/SMB share names), and open a Support Case for review. Be sure to include logs for Support to review. (Use the 3rd radio button to export logs from hosts, and select the Veeam server itself to export logs from)

Please share your case number here once created. Thanks!
David Domask | Product Management: Principal Analyst
Nico_GK
Lurker
Posts: 2
Liked: never
Joined: Jan 02, 2025 2:02 pm
Full Name: Nico R
Contact:

Re: Adding SMB source as 'directory' instead of 'Host'

Post by Nico_GK »

Hi David,
thanks for fast reply.
Yes, the job works. Or better say, it starts.
The problem is that Veeam considers all of the sources as 'host' during enumerating and thus tries to count it several times.

Normally it is one SMB host with several SMB shares as directories.
It then counts all directories once and lists the number of files/directories/size.
In the above case, it then counts this process for each share (that has been added as a host) and multiple licenses will also used for that.
Case is already open and I was advised to contact the forum here.
Case #07547168
david.domask
Veeam Software
Posts: 2622
Liked: 611 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Adding SMB source as 'directory' instead of 'Host'

Post by david.domask »

Thanks for the update Nico, and for sharing the case number. Will review internally with Support, please continue on the case as the behavior looks unexpected. Support should have an update for you soon with a few additional requests.
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests