License information

PowerShell script exchange

License information

Veeam Logoby b.vanhaastrecht » Wed Oct 14, 2015 7:50 am

Hello,

I would like to fetch the license information from the Enterprise Portal thru Powershell or the RestAPI. But I'm unable to find an CMDlet or schema providing this information. Is that correct?

I'm primairly interested in the support expiry date. What are my options to get it thru scripting?

Kind Regards,
Bastiaan
========================================
Veeam ProPartner and Cloud Connect Provider
b.vanhaastrecht
Service Provider
 
Posts: 335
Liked: 65 times
Joined: Mon Aug 26, 2013 7:46 am
Location: The Netherlands
Full Name: Bastiaan van Haastrecht

Re: License information

Veeam Logoby v.Eremin » Wed Oct 14, 2015 9:32 am

As far as I know, information regarding license is not present in PowerShell, neither is it in RESTful API. The only way I can think of is to query db directly. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: License information

Veeam Logoby PTide » Wed Oct 14, 2015 9:33 am 1 person likes this post

Hi,

Please try this:
Code: Select all
$regBinary = (Get-Item 'HKLM:\SOFTWARE\VeeaM\Veeam Backup and Replication\license').GetValue('Lic1')
$veeamLicInfo = [string]::Join($null, ($regBinary | % { [char][int]$_; }))


Kudos to this guy
PTide
Veeam Software
 
Posts: 3019
Liked: 246 times
Joined: Tue May 19, 2015 1:46 pm

Re: License information

Veeam Logoby b.vanhaastrecht » Wed Oct 14, 2015 9:38 am

Getting it thru the registry works, thanks! (had to adjuist the verison checking, but it works)

Would prefer something Veeam supported like RestAPI or PowerShell CMDlet, so I do not have to worry about this custom script to get incompliant with upcoming Veeam version upgrade.

So a feature request to fetch license information thru RestAPI or PowerShell please.
========================================
Veeam ProPartner and Cloud Connect Provider
b.vanhaastrecht
Service Provider
 
Posts: 335
Liked: 65 times
Joined: Mon Aug 26, 2013 7:46 am
Location: The Netherlands
Full Name: Bastiaan van Haastrecht

Re: License information

Veeam Logoby v.Eremin » Wed Oct 14, 2015 10:04 am

Your voice about availability of license information in our automation services has been heard. Thanks for the feedback; appreciated.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

[MERGED]:Get Cloud Connect Backup/Replica Usage Programmatic

Veeam Logoby tom.adams » Tue Mar 22, 2016 12:02 pm

Hello,

Under the License Information window in the Veeam Gui, does anyone know how to obtain these two values?

Cloud Connect (Backup)
Cloud Connect (Replica)

I could do with accessing the information via powershell, c# or the rest api as we are importing the information into another application. Just to clarify, i'm not looking for the information stored in the license, i'm looking to obtain the "Used" amount.

Any help is appreciated. Cheers
tom.adams
Service Provider
 
Posts: 2
Liked: never
Joined: Tue Nov 24, 2015 3:10 pm
Full Name: Thomas Adams

Re: License information

Veeam Logoby v.Eremin » Tue Mar 22, 2016 12:29 pm

General information:

Code: Select all
$BackupCount = 0
$ReplicaCount = 0
foreach ($Tenant in Get-VBRCloudTenant)
{
    $BackupCount = $BackupCount + $Tenant.VMCount
    $ReplicaCount = $ReplicaCount + $Tenant.ReplicaCount
}
$BackupCount, $ReplicaCount


Information per tenant:

Code: Select all
Get-VBRCloudTenant | select -Property @{N="Tenant";E={$_.name}}, @{N="Backup Count";E={$_.VMCount}}, @{N="Replica Count";E={$_.ReplicaCount}} | ft   


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

Re: License information

Veeam Logoby tom.adams » Tue Mar 22, 2016 1:53 pm

Thanks Vladimir,

I had to update the script you provided slightly as we have some cloud tenants that are disabled or they have an expiration date which has now expired.
Here is the updated script just in case someone needs the same information


Code: Select all
$BackupCount = 0
$ReplicaCount = 0

Get-VBRCloudTenant | Where-Object {($_.Enabled -eq $TRUE) -and (($_.LeaseExpirationEnabled -eq $FALSE) -or (($_.LeaseExpirationEnabled -eq $TRUE) -and ($_.LeaseExpirationDate -gt (Get-Date))))} | ForEach-Object {
$BackupCount = $BackupCount + $_.VMCount
$ReplicaCount = $ReplicaCount + $_.ReplicaCount
}

$BackupCount, $ReplicaCount


Before it was slightly off with the values but now it seems to be reporting correctly. Many Thanks!
tom.adams
Service Provider
 
Posts: 2
Liked: never
Joined: Tue Nov 24, 2015 3:10 pm
Full Name: Thomas Adams

Re: License information

Veeam Logoby v.Eremin » Wed Mar 23, 2016 12:03 pm

Glad to hear my input was helpful. The updated script looks good, thanks for sharing!
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

[MERGED]: Reporting on license count

Veeam Logoby onthax » Wed May 11, 2016 1:45 am

Hi All,

We are trying to report on our license count, can either do this from powershell or sql to inject it into our monitoring server and get backup license trending.

what we've found recently is that our licensing in veeam is far in excess of what we see from our SQL query and what we expect in the environment. (Over 100 protected VMs higher)

Anyone aware of an SQL query that can be run against the veeam database to return this number
onthax
Service Provider
 
Posts: 9
Liked: never
Joined: Mon May 13, 2013 2:32 am
Location: Brisbane

Re: License information

Veeam Logoby PTide » Wed May 11, 2016 10:05 am

Hi Onthax,

Please review the thread and feel free to ask additional questions if any arise.

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

[MERGED] Veeam License Monitoring

Veeam Logoby toxicavenger » Tue Oct 04, 2016 10:47 am 1 person likes this post

Hi,

Is there a way to extract some infomation about the current license in use through powershell. I need informations like number of VMs assigned to our license and how much we got left.
toxicavenger
Novice
 
Posts: 3
Liked: 1 time
Joined: Fri Jun 10, 2016 9:03 am


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests