-
- Novice
- Posts: 5
- Liked: never
- Joined: Aug 07, 2014 9:06 am
- Full Name: Sebastien
- Contact:
MyVeeamReport exclude Folders
Hello
Excuse me for my english
I use the script smasterson MyVeeamReport.ps1
(https://gist.github.com/smasterson/9136 ... report-ps1)
But excluding folders does not work or simply for a folder,
you have an idea for multiples folders ?
# To Exclude Missing VMs from VM Backups report add names to be excluded as follows
# $ @ = Excludevms ("vm1", "vm2", "* _replica")
$ @ excludeVMs = ("")
# Exclude Missing VMs from backups report in the following (vCenter) folder
folderExclude $ = ""
folderExclude $ = "No_backup" = OK
folderExclude $ = "No_backup,No_backup_citrix" = KO
folderExclude $ = "No_backup","No_backup_citrix" = KO
folderExclude $ = "No_backup" "No_backup_citrix" = KO
Thank you in advance
Excuse me for my english
I use the script smasterson MyVeeamReport.ps1
(https://gist.github.com/smasterson/9136 ... report-ps1)
But excluding folders does not work or simply for a folder,
you have an idea for multiples folders ?
# To Exclude Missing VMs from VM Backups report add names to be excluded as follows
# $ @ = Excludevms ("vm1", "vm2", "* _replica")
$ @ excludeVMs = ("")
# Exclude Missing VMs from backups report in the following (vCenter) folder
folderExclude $ = ""
folderExclude $ = "No_backup" = OK
folderExclude $ = "No_backup,No_backup_citrix" = KO
folderExclude $ = "No_backup","No_backup_citrix" = KO
folderExclude $ = "No_backup" "No_backup_citrix" = KO
Thank you in advance
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: MyVeeamReport exclude Folders
Can you elaborate on that? You mean the script can only exclude VMs coming from one folder, not multiple ones? Thanks.But excluding folders does not work or simply for a folder, you have an idea for multiples folders ?
-
- Novice
- Posts: 5
- Liked: never
- Joined: Aug 07, 2014 9:06 am
- Full Name: Sebastien
- Contact:
Re: MyVeeamReport exclude Folders
hello
No, it is the exclusion of a complete folder in datacenter , with one folder it works, but not with more
Exemple :
# Exclude Missing VMs from backups report in the following (vCenter) folder
folderExclude $ = ""
folderExclude $ = "No_backup" = OK ( all VM in folder is exclude )
But with multiples folders in variables , dont work
folderExclude $ = "No_backup,No_backup_citrix" = KO
folderExclude $ = "No_backup","No_backup_citrix" = KO
folderExclude $ = "No_backup" "No_backup_citrix" = KO
thanks
No, it is the exclusion of a complete folder in datacenter , with one folder it works, but not with more
Exemple :
# Exclude Missing VMs from backups report in the following (vCenter) folder
folderExclude $ = ""
folderExclude $ = "No_backup" = OK ( all VM in folder is exclude )
But with multiples folders in variables , dont work
folderExclude $ = "No_backup,No_backup_citrix" = KO
folderExclude $ = "No_backup","No_backup_citrix" = KO
folderExclude $ = "No_backup" "No_backup_citrix" = KO
thanks
-
- Veeam Software
- Posts: 649
- Liked: 170 times
- Joined: Dec 10, 2012 8:44 am
- Full Name: Nikita Efes
- Contact:
Re: MyVeeamReport exclude Folders
Could you try ?
It will create an array with two elements rather than one big string
Code: Select all
$folderExclude = @("No_backup", "No_backup_citrix")
It will create an array with two elements rather than one big string
-
- Novice
- Posts: 5
- Liked: never
- Joined: Aug 07, 2014 9:06 am
- Full Name: Sebastien
- Contact:
Re: MyVeeamReport exclude Folders
hello
I also tested the same result.
$folderExclude = @("No_backup", "No_backup_citrix")
If I place a folder OK, as soon as there are at least two, it does not work.
The folder name is good, one by one is OK
Thanks
I also tested the same result.
$folderExclude = @("No_backup", "No_backup_citrix")
If I place a folder OK, as soon as there are at least two, it does not work.
The folder name is good, one by one is OK
Thanks
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: MyVeeamReport exclude Folders
Then, some sort of cycle seems to be required within the script provided. Based on your description, currently script can only exclude only one folder. So, you will have to add cycle to the script. Within the cycle specified folders will be taken and excluded one by one. Thanks.
-
- Veeam Software
- Posts: 649
- Liked: 170 times
- Joined: Dec 10, 2012 8:44 am
- Full Name: Nikita Efes
- Contact:
Re: MyVeeamReport exclude Folders
After some reading of the script you linked, seems that I find the reason. The string 443
should be changed to
After that $folderExclude = @("No_backup", "No_backup_citrix") should work. Please be aware, this search is case-specific ("no_backup" folder will not be excluded)
Code: Select all
$vmobjs = Find-VBRObject -Server $vcenterobj | Where-Object {$_.Type -eq "VirtualMachine" -and $_.VMFolderName -notlike $script:folderExclude}
Code: Select all
$vmobjs = Find-VBRObject -Server $vcenterobj | Where-Object {$_.Type -eq "VirtualMachine" -and $_.VMFolderName -notin $script:folderExclude}
-
- Novice
- Posts: 5
- Liked: never
- Joined: Aug 07, 2014 9:06 am
- Full Name: Sebastien
- Contact:
Re: MyVeeamReport exclude Folders
Hello ,
Thank you for your help.
I'm testing, but following the change
Thanks
Thank you for your help.
I'm testing, but following the change
Code: Select all
PS C:\Users\root> U:\prc\veeam\Rapport_Veeam_Quotidien.ps1
Vous devez fournir une expression de valeur à droite de l'opérateur « - ». ( You must provide a value expression on the right of the "-" operator. )
Au niveau de U:\prc\veeam\Rapport_Veeam_Quotidien.ps1 : 362 Caractère : 114
+ $vmobjs = Find-VBRObject -Server $vcenterobj | Where-Object {$_.Type -eq "VirtualMachine" -and $_.VMFolderName - <<<< notin $script:folderExclude}
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : ExpectedValueExpression
Thanks
-
- Veeam Software
- Posts: 649
- Liked: 170 times
- Joined: Dec 10, 2012 8:44 am
- Full Name: Nikita Efes
- Contact:
Re: MyVeeamReport exclude Folders
Seems that "-notin" comparator is presented only in PowerShell 3.0
If you want to use Powershell 2.0, you could try "-notcontains", but you should switch places of parameters:
If you want to use Powershell 2.0, you could try "-notcontains", but you should switch places of parameters:
Code: Select all
$vmobjs = Find-VBRObject -Server $vcenterobj | Where-Object {$_.Type -eq "VirtualMachine" -and $script:folderExclude -notcontains $_.VMFolderName}
-
- Novice
- Posts: 5
- Liked: never
- Joined: Aug 07, 2014 9:06 am
- Full Name: Sebastien
- Contact:
Re: MyVeeamReport exclude Folders
Hello
Thank you very much for your quick response, it works fine, I tested with ten records and perfect.
And Shawn Masterson offered me this solution also works great
On line 21
Separate multiple folders with a | like so
On line 443
Lets change this from -notlike to -notmatch
Thank you again
Thank you very much for your quick response, it works fine, I tested with ten records and perfect.
And Shawn Masterson offered me this solution also works great
On line 21
Code: Select all
$folderExclude = ""
Code: Select all
$folderExclude = "folder1|folder2|folder3"
On line 443
Code: Select all
$vmobjs = Find-VBRObject -Server $vcenterobj | Where-Object {$_.Type -eq "VirtualMachine" -and $_.VMFolderName -notlike $script:folderExclude}
Code: Select all
$vmobjs = Find-VBRObject -Server $vcenterobj | Where-Object {$_.Type -eq "VirtualMachine" -and $_.VMFolderName -notmatch $script:folderExclude}
Thank you again
Who is online
Users browsing this forum: No registered users and 15 guests