PowerShell script exchange
Post Reply
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

notification on file backup job

Post by matteu »

Hello,

I don't find in powershell the command to get this information : Storage -> advanced -> notification tab -> Severity options :
-Make file or folder processing issues result in a job warning
-Make file or folder attribute's processing issues result in a job warning

Whare can I find it ?

It's not in notificationOptions property.

Thanks
oleg.feoktistov
Veeam Software
Posts: 1919
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: notification on file backup job

Post by oleg.feoktistov »

Hi matteu,

Yes, it is not there in VBRNASBackupJob type. I noted it as an enhancement request.
As a workaround you can get it with Get-VBRJob cmdlet. This way is unsupported for NAS Backup jobs, but it works:

Code: Select all

$job = Get-VBRJob -Name 'File Backup Job'
$job.Options.NASBackupOptions.FileProcessingIssuesMarkingFlags
This property holds an enum and implements both checkboxes. Possible values:

Code: Select all

 
PS C:\Windows\system32> $enum = [Veeam.Backup.Model.EFileProcessingIssuesMarkingFlags] 
$enum.GetEnumValues()
None
MarkFileAndFolderIssuesAsWarnings
MarkFileAndFolderAttributesIssuesAsWarnings
EverythingAsWarnings 
Best regards,
Oleg
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: notification on file backup job

Post by matteu »

Wow ! Thanks for your answer.

I see you can find all possible values with your last lines...
Is there any way to do it for all command ?
If I want to know all Veeam job type without needing to create them ?
If I can do it, this can save me a lot of time, and it will improve my powershell knowledge because I'm testing all possibilities for each options now to see the different values...
oleg.feoktistov
Veeam Software
Posts: 1919
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: notification on file backup job

Post by oleg.feoktistov »

If going after job types, you can do this:

Code: Select all

$jobType = [Veeam.Backup.Model.EDbJobType]
$JobType.GetEnumValues()
It's quite raw, but represents all job types, not only those with schedule.
Thanks!
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: notification on file backup job

Post by matteu »

Thanks for your help.
I totally ignore enum usage but it's wonderfull :)

I will not need anymore to build hv cluster / scvmm or something else to know what value it is :)

Is there a command to know what are all the veeam static class and method ?

I find something for all installed in a computer :

Code: Select all

[AppDomain]::CurrentDomain.GetAssemblies() | foreach { $_.GetTypes() } | foreach { $_.GetMethods() } | where { $_.IsStatic } | select DeclaringType | Out-File assemblies.txt
But it's too long to execute (I filtered to have only veeam.dll files) and really hard to "manage".
oleg.feoktistov
Veeam Software
Posts: 1919
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: notification on file backup job

Post by oleg.feoktistov »

This method still requires to know assemblies' names from the start to filter only Veeam ones and avoid querying the whole list.
Try the way I described in the other thread instead. Thanks!
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: notification on file backup job

Post by matteu »

Perfect for NAS values :

Code: Select all

$NASBackupJobsReq = Get-VBRJob | where {$_.TypeToString -eq "File Backup"}
$NASBackupJobs = foreach ($element in $NASBackupJobsReq)
{

       $NASnotification = $element.Options.NASBackupOptions.FileProcessingIssuesMarkingFlags
        FileProcessing = if($NASnotification -eq "MarkFileAndFolderIssuesAsWarnings" -or $NASnotification -eq "EverythingAsWarnings"){$true} else {$false}
        FolderAttribute = if($NASnotification -eq "MarkFileAndFolderAttributesIssuesAsWarnings" -or $NASnotification -eq "EverythingAsWarnings"){$true} else {$false}
}
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests