PowerShell script exchange
andershh
Service Provider
Posts: 2 Liked: never
Joined: Oct 30, 2015 9:56 am
Contact:
Post
by andershh » Oct 30, 2015 10:01 am
this post
Hello.
I wondered if there is a way to gather the number of VMs you currently have protected as in this screenshot below:
Thanks in advance!
Best regards
Anders Hagen Hansen
PTide
Product Manager
Posts: 6576 Liked: 773 times
Joined: May 19, 2015 1:46 pm
Contact:
Post
by PTide » Oct 30, 2015 1:58 pm
1 person likes this post
Hi,
In your case (Cloud) VMs that have at least one restore point are considered to be protected, no matter how old that restore is. Hence all you need to do is get total list of retore points, select by VM names, get unique and count lines. Pleas try the following code and check if the number matches:
Code: Select all
(Get-VBRRestorePoint | select {$_.VmName} -uniq).Count
Btw, have you considered using Veeam ONE reports to get the statistics about your environment?
Thank you.
veremin
Product Manager
Posts: 20677 Liked: 2382 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Nov 03, 2015 4:46 pm
this post
Since we're talking here about Service Provider's site, I don't think that tenants restore points are reflected there, thus, Get-VBRRestorePoint would return either local restore points created by SP himself or nothing.
In order to achieve your goal, you should query CloudTenant entity or, more specifically,
VMCount property:
Thanks.
LeslieBNS9
Lurker
Posts: 2 Liked: never
Joined: Oct 14, 2014 2:29 pm
Full Name: Leslie B
Post
by LeslieBNS9 » Jul 05, 2016 3:41 pm
this post
Anyone know how to get the "Managed VMs" count through PowerShelll?
I tried the below command from a previous
post . But the counts are coming back different.
Code: Select all
(Get-VBRRestorePoint | select {$_.VmName} -uniq).Count
PTide
Product Manager
Posts: 6576 Liked: 773 times
Joined: May 19, 2015 1:46 pm
Contact:
Post
by PTide » Jul 05, 2016 4:02 pm
this post
Hi,
May I ask you what were the numbers it returned/you expected?
Thanks
LeslieBNS9
Lurker
Posts: 2 Liked: never
Joined: Oct 14, 2014 2:29 pm
Full Name: Leslie B
Post
by LeslieBNS9 » Jul 05, 2016 4:07 pm
this post
Here's what I'm looking for...
With this command I'm getting 609.
Code: Select all
(Get-VBRRestorePoint | select {$_.VmName} -uniq).Count
I added a filter for IsLicensed and I'm getting 562 with this command.
Code: Select all
(Get-VBRRestorePoint | Where {$_.IsLicensed -eq $true} | select {$_.Name} -uniq).Count
veremin
Product Manager
Posts: 20677 Liked: 2382 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Jul 06, 2016 8:03 am
this post
Aren't there any imported restore points among those listed? You can double check it, using the following one-liner:
Code: Select all
(Get-VBRRestorePoint | ?{($_.FindBackup().name) -notlike "*_imported*"}).count
Thanks.
Users browsing this forum: Baidu [Spider] and 12 guests