Maintain control of your Microsoft 365 data
Post Reply
kevin.boddy
Service Provider
Posts: 206
Liked: 14 times
Joined: Jan 30, 2018 3:24 pm
Full Name: Kevin Boddy
Contact:

Automate storage consumption and license usage reports

Post by kevin.boddy »

Hi,

Is there anyway to automate storage consumption and license usage reports for a backup job and backup repository?

I don't see this function the VBM and Veeam ONE does not have these reports either.

I am hoping there is another way to get this information other than manually running the report and then copying and pasting out of the PDFs.

Thanks
Kevin
Mildur
Product Manager
Posts: 10288
Liked: 2747 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Automate storage consumption and license usage reports

Post by Mildur »

Hi Kevin

You can always use PowerShell to build your own automation scripts which can export CSV files
Schedule there scripts with windows task scheduler.
Please let me know if you have additional questions.

Get-VBOStorageConsumptionReport
https://helpcenter.veeam.com/docs/vbo36 ... tml?ver=70

Get-VBOLicenseOverviewReport
https://helpcenter.veeam.com/docs/vbo36 ... tml?ver=70

Best,
Fabian
Product Management Analyst @ Veeam Software
kevin.boddy
Service Provider
Posts: 206
Liked: 14 times
Joined: Jan 30, 2018 3:24 pm
Full Name: Kevin Boddy
Contact:

Re: Automate storage consumption and license usage reports

Post by kevin.boddy »

Hi,

Thank you for the reply. I am looking for a report for a backup repository or backup job.

Is there a way to filter these output to only include a specific job or repo automatically using built in Veeam tooling?

Thanks
Kevin
karsten123
Service Provider
Posts: 572
Liked: 140 times
Joined: Apr 03, 2019 6:53 am
Full Name: Karsten Meja
Contact:

Re: Automate storage consumption and license usage reports

Post by karsten123 »

it is possible to generate the reports in format csv and process the data as you need it.
kevin.boddy
Service Provider
Posts: 206
Liked: 14 times
Joined: Jan 30, 2018 3:24 pm
Full Name: Kevin Boddy
Contact:

Re: Automate storage consumption and license usage reports

Post by kevin.boddy »

Hi,

Thanks for the reply.

I'll looking for something built into Veeam using Veeam tooling that can do this automatically.

For now we'll have use a manually process.

Thanks
Kevin
DanielJ
Service Provider
Posts: 261
Liked: 47 times
Joined: Jun 10, 2019 12:19 pm
Full Name: Daniel Johansson
Contact:

Re: Automate storage consumption and license usage reports

Post by DanielJ » 1 person likes this post

Here is a script I wrote to get a simple report of backed up organizations, number of backed up users, amount of backup data and retention. It assumes each repository has data from a single customer, and that all data is on object storage. Maybe you can adapt it to fit your needs. The script returns html, so redirect output to a file.

Code: Select all

$ErrorActionPreference = "Stop"
$stopwatch = [System.Diagnostics.Stopwatch]::startNew()
$timestamp = get-date -format "yyyy-MM-dd HH:mm"
$backup_server = $env:COMPUTERNAME.ToLower()
$GBonly = $false

$customertable = new-object System.Collections.Generic.List[string]
$warnings = new-object System.Collections.Generic.List[string]

$header = @"
<style>
TABLE {border-width: 1px; border-style: solid; border-color: black; border-collapse: collapse;}
TH {border-width: 1px; padding: 3px; border-style: solid; border-color: black; background-color: #00b000; color: #ffffff}
TD {border-width: 1px; padding: 3px; border-style: solid; border-color: black;}
h1 {margin-top: 3px; margin-bottom: 6px; font-size:50px;}
h2 {margin-top: 3px; margin-bottom: 6px;}
</style>
"@

$right_cell = '<td style="text-align:right">'

function NiceSize {
  param([double]$numc)
  $num = $numc + 0
  if ($GBonly) { return ("{0:f1} GB" -f ($num / 1GB)) }
  $trailing = "", "K", "M", "G", "T", "P", "E"
  $i = 0
  while($num -gt 1024 -and $i -lt 6) {
    $num = $num / 1024
    $i++
  }
  if ($i -eq 0) {
    return "$($num) bytes"
  } else {
    return ("{0:f1} {1}B" -f $num, $trailing[$i])
  }
}

$orgs = Get-VBOOrganization
$repos = Get-VBORepository
$org_bytes = @{}
$org_users = @{}
$org_retention = @{}

foreach ($org in $orgs) {
  $usagedata = Get-VBOUsageData -organization $org
  $org_bytes.Add($org.Name.ToLower(), $usagedata.ObjectStorageUsedSpace)
}

foreach ($repo in $repos) {
  $repousers = Get-VBOEntityData -type user -repository $repo
  foreach ($user in $repousers) {
    $org_name = $user.Organization.DisplayName.ToLower()
    if ($org_users.ContainsKey($org_name)) {
      $org_users[$org_name]++
    } else {
      $org_users.Add($org_name, 1)
    }
  }
  $repoorgs = Get-VBOEntityData -type organization -repository $repo
  if ($repoorgs.Count > 1) {
    $warnings.Add("Note! Repository '$($repo.Name)' has data from multiple organizations!")
  }
  foreach ($repoorg in $repoorgs) {
    $org_name = $repoorg.DisplayName.ToLower()
    if ($org_retention.ContainsKey($org_name)) {
      $org_retention[$org_name].Add($repo.RetentionPeriod)
    } else {
      $newlist = new-object System.Collections.Generic.List[string]
      $org_retention.Add($org_name, $newlist)
      $org_retention[$org_name].Add($repo.RetentionPeriod)
    }
  }
}

$customertable.Add("<table>")
$customertable.Add("<colgroup><col/><col/><col/><col/></colgroup>")
$customertable.Add("<tr><th>Customer</th><th>Backed up users</th><th>Backup data</th><th>Retention period</th></tr>")

foreach ($org in ($org_bytes.GetEnumerator()|sort -property Key)) {
  $name = $org.Key.ToLower()
  $users = $org_users[$name]
  $size = NiceSize $org_bytes[$name]
  $raw_retention = ($org_retention[$name]|select -unique) -join '/'

  if (!$users) { $users = 0 }
  if (!$raw_retention) { $raw_retention = 'No data' }

  $customer = switch ($name) {
    'organization1.onmicrosoft.com'        { 'Insert friendly'; break }
    'organization2.onmicrosoft.com'        { 'customer names'; break }
    'another_organization.onmicrosoft.com' { 'on these lines'; break }
    default                                { $name; break}
  }

  $retention = switch ($raw_retention) {
    'Year1'        { '1 year'; break }
    'Years2'       { '2 years'; break }
    'Years3'       { '3 years'; break }
    'Years5'       { '5 years'; break }
    'Years7'       { '7 years'; break } 
    'Years10'      { '10 years'; break }
    'Years25'      { '25 years'; break }
    'KeepForever'  { 'Keep forever'; break }
    'No data'      { 'No data'; break }
    default        { "$raw_retention days"; break }
  }

  $customertable.Add("<tr><td><b>$customer</b></td>$right_cell$users</td>$right_cell$size</td>$right_cell$retention</td></tr>")

}

$customertable.Add("</table>")

$stopwatch.Stop()
$seconds = [Math]::Round(($stopwatch.Elapsed.TotalSeconds), 1, 1)
$title = "<h2>Microsoft 365 backup report</h2>generated in $seconds seconds at $timestamp on $backup_server<hr>"
$output = (ConvertTo-Html -head $header -body "$($title)$($customertable)$($warnings)" -title "Microsoft 365 backup report")|Out-String

write-output $output
kevin.boddy
Service Provider
Posts: 206
Liked: 14 times
Joined: Jan 30, 2018 3:24 pm
Full Name: Kevin Boddy
Contact:

Re: Automate storage consumption and license usage reports

Post by kevin.boddy »

Thank you for sharing.
Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests