PowerShell number of Protected VMs

PowerShell script exchange

PowerShell number of Protected VMs

Veeam Logoby andershh » Fri Oct 30, 2015 10:01 am

Hello.

I wondered if there is a way to gather the number of VMs you currently have protected as in this screenshot below:

Image

Thanks in advance!

Best regards
Anders Hagen Hansen
andershh
Service Provider
 
Posts: 2
Liked: never
Joined: Fri Oct 30, 2015 9:56 am

Re: PowerShell number of Protected VMs

Veeam Logoby PTide » Fri 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.
PTide
Veeam Software
 
Posts: 3019
Liked: 246 times
Joined: Tue May 19, 2015 1:46 pm

Re: PowerShell number of Protected VMs

Veeam Logoby v.Eremin » Tue Nov 03, 2015 4:46 pm

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:

Code: Select all
(Get-VBRCloudTenant).VMCount


Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Managed VMs Count

Veeam Logoby LeslieBNS9 » Tue Jul 05, 2016 3:41 pm

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
LeslieBNS9
Lurker
 
Posts: 2
Liked: never
Joined: Tue Oct 14, 2014 2:29 pm
Full Name: Leslie B

Re: Managed VMs Count

Veeam Logoby PTide » Tue Jul 05, 2016 4:02 pm

Hi,

May I ask you what were the numbers it returned/you expected?

Thanks
PTide
Veeam Software
 
Posts: 3019
Liked: 246 times
Joined: Tue May 19, 2015 1:46 pm

Re: Managed VMs Count

Veeam Logoby LeslieBNS9 » Tue Jul 05, 2016 4:07 pm

Here's what I'm looking for... Image

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
LeslieBNS9
Lurker
 
Posts: 2
Liked: never
Joined: Tue Oct 14, 2014 2:29 pm
Full Name: Leslie B

Re: PowerShell number of Protected VMs

Veeam Logoby v.Eremin » Wed Jul 06, 2016 8:03 am

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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 2 guests