Skip to content

Commit

Permalink
Merge pull request #6 from AsBuiltReport/dev
Browse files Browse the repository at this point in the history
v0.2.0 public release
  • Loading branch information
rebelinux authored Apr 22, 2023
2 parents bfbc062 + ed4ead8 commit e5462ae
Show file tree
Hide file tree
Showing 21 changed files with 819 additions and 109 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
shell: pwsh
run: |
Install-Module -Name AsBuiltReport.Core -Repository PSGallery -Force
- name: Install PScriboCharts module
shell: pwsh
run: |
Install-Module -Name PScriboCharts -Repository PSGallery -Force
- name: Test Module Manifest
shell: pwsh
run: |
Expand Down
6 changes: 5 additions & 1 deletion AsBuiltReport.Veeam.VB365.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AsBuiltReport.Veeam.VB365.psm1'

# Version number of this module.
ModuleVersion = '0.1.1'
ModuleVersion = '0.2.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -57,6 +57,10 @@ RequiredModules = @(
ModuleName = 'AsBuiltReport.Core';
ModuleVersion = '1.3.0'
}
@{
ModuleName = 'PScriboCharts';
ModuleVersion = '0.9.0'
}
)

# Assemblies that must be loaded prior to importing this module
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# :arrows_clockwise: Veeam VB365 As Built Report Changelog

## [0.2.0] - 2023-04-22

### Added
* Improved organization section
* Added Office365 synchronization state
* Added Office365 SharePoint Connection Settings
* Added Office365 Exchange Connection Settings
* Added backup job status chart

## [0.1.1] - 2023-03-29

### Added
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ This report is compatible with the following PowerShell versions;
PowerShell 5.1, and the following PowerShell modules are required for generating a Veeam VB365 As Built Report.

- [Veeam.Archiver.PowerShell Module](https://helpcenter.veeam.com/docs/vbo365/powershell/getting_started.html?ver=70)
- [PScriboCharts Module](https://github.com/iainbrighton/PScriboCharts)
- [AsBuiltReport.Veeam.VB365 Module](https://www.powershellgallery.com/packages/AsBuiltReport.Veeam.VB365/)

### :closed_lock_with_key: Required Privileges
Expand Down
552 changes: 461 additions & 91 deletions Samples/Sample Veeam VB365 As Built Report.html

Large diffs are not rendered by default.

Binary file modified Samples/Sample Veeam VB365 As Built Report.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion Src/Private/Get-AbrVb365BackupCopyJob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function Get-AbrVb365BackupCopyJob {
}
}
} else {
Paragraph "The following table summarises the configuration of the backup copy jobs within the $VeeamBackupServer backup server."
Paragraph "The following table summarizes the configuration of the backup copy jobs within the $VeeamBackupServer backup server."
BlankLine
$TableParams = @{
Name = "Backup Copy Job - $VeeamBackupServer"
Expand Down
64 changes: 62 additions & 2 deletions Src/Private/Get-AbrVb365BackupJob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-AbrVb365BackupJob {
.DESCRIPTION
Documents the configuration of Veeam VB365 in Word/HTML/Text formats using PScribo.
.NOTES
Version: 0.1.1
Version: 0.2.0
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -61,8 +61,64 @@ function Get-AbrVb365BackupJob {
$BackupJobInfo | Where-Object { $_.'Last Status' -ne 'Success' } | Set-Style -Style Warning -Property 'Last Status'
}

try {
$Alljobs = @()
if ($BackupJobs.LastStatus) {
$Alljobs += $BackupJobs.LastStatus
}
if ((Get-VBOCopyJob -ErrorAction SilentlyContinue).LastStatus) {
$Alljobs += (Get-VBOCopyJob -ErrorAction SilentlyContinue).LastStatus
}

$sampleData = $Alljobs | Group-Object
$exampleChart = New-Chart -Name BackupJobs -Width 600 -Height 400

$addChartAreaParams = @{
Chart = $exampleChart
Name = 'BackupJobs'
AxisXTitle = 'Status'
AxisYTitle = 'Count'
NoAxisXMajorGridLines = $true
NoAxisYMajorGridLines = $true
}
$exampleChartArea = Add-ChartArea @addChartAreaParams -PassThru

$addChartSeriesParams = @{
Chart = $exampleChart
ChartArea = $exampleChartArea
Name = 'exampleChartSeries'
XField = 'Name'
YField = 'Count'
Palette = 'Green'
ColorPerDataPoint = $true
}
$sampleData | Add-ColumnChartSeries @addChartSeriesParams

$addChartTitleParams = @{
Chart = $exampleChart
ChartArea = $exampleChartArea
Name = 'BackupJob'
Text = 'Jobs Latest Result'
Font = New-Object -TypeName 'System.Drawing.Font' -ArgumentList @('Arial', '12', [System.Drawing.FontStyle]::Bold)
}
Add-ChartTitle @addChartTitleParams

$chartFileItem = Export-Chart -Chart $exampleChart -Path (Get-Location).Path -Format "PNG" -PassThru

if ($PassThru)
{
Write-Output -InputObject $chartFileItem
}
}
catch {
Write-PscriboMessage -IsWarning "Backup Copy Chart Section: $($_.Exception.Message)"
}

if ($InfoLevel.Jobs.BackupJob -ge 2) {
Paragraph "The following sections detail the configuration of the backup job within $VeeamBackupServer backup server."
if ($chartFileItem) {
Image -Text 'Backup Repository - Diagram' -Align 'Center' -Percent 100 -Path $chartFileItem
}
foreach ($BackupJob in $BackupJobInfo) {
Section -ExcludeFromTOC -Style NOTOCHeading3 "$($BackupJob.Name)" {
$TableParams = @{
Expand All @@ -77,7 +133,11 @@ function Get-AbrVb365BackupJob {
}
}
} else {
Paragraph "The following table summarises the configuration of the backup jobs within the $VeeamBackupServer backup server."
Paragraph "The following table summarizes the configuration of the backup jobs within the $VeeamBackupServer backup server."
BlankLine
if ($chartFileItem) {
Image -Text 'Backup Repository - Diagram' -Align 'Center' -Percent 100 -Path $chartFileItem
}
BlankLine
$TableParams = @{
Name = "Backup Job - $VeeamBackupServer"
Expand Down
2 changes: 1 addition & 1 deletion Src/Private/Get-AbrVb365BackupRepository.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function Get-AbrVB365BackupRepository {
}
}
} else {
Paragraph "The following table summarises the configuration of the backup repository within within the $VeeamBackupServer backup server."
Paragraph "The following table summarizes the configuration of the backup repository within within the $VeeamBackupServer backup server."
BlankLine
$TableParams = @{
Name = "Repositories - $VeeamBackupServer"
Expand Down
2 changes: 1 addition & 1 deletion Src/Private/Get-AbrVb365CloudCredential.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function Get-AbrVb365CloudCredential {
}
}
} else {
Paragraph "The following table summarises the configuration of the cloud credentials within the $VeeamBackupServer backup server."
Paragraph "The following table summarizes the configuration of the cloud credentials within the $VeeamBackupServer backup server."
BlankLine
$TableParams = @{
Name = "Cloud Credentials - $VeeamBackupServer"
Expand Down
2 changes: 1 addition & 1 deletion Src/Private/Get-AbrVb365EncryptionKey.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function Get-AbrVB365EncryptionKey {
}
}
} else {
Paragraph "The following table summarises the configuration of the encryption key within the $VeeamBackupServer backup server."
Paragraph "The following table summarizes the configuration of the encryption key within the $VeeamBackupServer backup server."
BlankLine
$TableParams = @{
Name = "Encryption Keys - $VeeamBackupServer"
Expand Down
2 changes: 1 addition & 1 deletion Src/Private/Get-AbrVb365ObjectRepository.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function Get-AbrVB365ObjectRepository {
}
}
} else {
Paragraph "The following table summarises the configuration of the object repository within within the $VeeamBackupServer backup server."
Paragraph "The following table summarizes the configuration of the object repository within within the $VeeamBackupServer backup server."
BlankLine
$TableParams = @{
Name = "Object Repositories - $VeeamBackupServer"
Expand Down
43 changes: 40 additions & 3 deletions Src/Private/Get-AbrVb365Organization.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-AbrVb365Organization {
.DESCRIPTION
Documents the configuration of Veeam VB365 in Word/HTML/Text formats using PScribo.
.NOTES
Version: 0.1.1
Version: 0.2.0
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -34,6 +34,9 @@ function Get-AbrVb365Organization {
'Name' = $Organization.Name
'Type' = $Organization.Type
'Server' = $Organization.Server
'Region' = $Organization.Region
'Username' = $Organization.Username
'Office Name' = $Organization.OfficeName
'Use SSL' = ConvertTo-TextYN $Organization.UseSSL
'BackedUp' = ConvertTo-TextYN $Organization.IsBackedUp
'Licensing Options' = "Licensed Users:$($Organization.LicensingOptions.LicensedUsersCount)\Trial Users:$($Organization.LicensingOptions.TrialUsersCount)"
Expand All @@ -43,9 +46,36 @@ function Get-AbrVb365Organization {
'Skip Revocation Check' = ConvertTo-TextYN $Organization.SkipRevocationCheck
'Is Exchange Server' = ConvertTo-TextYN $Organization.IsExchange
'Is SharePoint' = ConvertTo-TextYN $Organization.IsSharePoint
'Backup Accounts' = $Organization.BackupAccounts
'Backup Applications' = $Organization.BackupApplications
'Backup Teams' = ConvertTo-TextYN $Organization.BackupTeams
'Backup Teams Chats' = ConvertTo-TextYN $Organization.BackupTeamsChats
'Grant Access To Site Collections' = ConvertTo-TextYN $Organization.GrantAccessToSiteCollections
'Description' = ConvertTo-EmptyToFiller $Organization.Description

}

if ($inObj.Type -ne "Office365") {
$inObj.remove("Backup Teams")
$inObj.remove("Backup Teams Chats")
$inObj.remove("Backup Applications")
$inObj.remove("Backup Accounts")
$inObj.remove("Region")
$inObj.remove("Office Name")
$inObj.remove("Grant Access To Site Collections")
}


if ($inObj.Type -eq "Office365") {
$inObj.remove("Skip CA Verification")
$inObj.remove("Skip Common Name Verification")
$inObj.remove("Skip Revocation Check")
$inObj.remove("Is Exchange Server")
$inObj.remove("Is SharePoint")
$inObj.remove("Server")
$inObj.remove("Use SSL")
}

$OrganizationInfo += [PSCustomObject]$InObj
}

Expand All @@ -57,7 +87,7 @@ function Get-AbrVb365Organization {
if ($InfoLevel.Infrastructure.Organization -ge 2) {
Paragraph "The following sections detail the configuration of the organization within $VeeamBackupServer backup server."
foreach ($Organization in $OrganizationInfo) {
Section -ExcludeFromTOC -Style NOTOCHeading3 "$($Organization.Name)" {
Section -Style Heading3 "$($Organization.Name)" {
$TableParams = @{
Name = "Organization - $($Organization.Name)"
List = $true
Expand All @@ -66,11 +96,18 @@ function Get-AbrVb365Organization {
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}

$Organization | Table @TableParams

if ($Organization.Type -eq "Office365") {
Get-AbrVb365OrganizationSyncState -Organization $Organization.Name
Get-AbrVb365OrganizationEXConnSetting -Organization $Organization.Name
Get-AbrVb365OrganizationSPConnSetting -Organization $Organization.Name
}
}
}
} else {
Paragraph "The following table summarises the configuration of the organizations within the $VeeamBackupServer backup server."
Paragraph "The following table summarizes the configuration of the organizations within the $VeeamBackupServer backup server."
BlankLine
$TableParams = @{
Name = "Organizations - $VeeamBackupServer"
Expand Down
74 changes: 74 additions & 0 deletions Src/Private/Get-AbrVb365OrganizationEXConnSetting.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
function Get-AbrVb365OrganizationEXConnSetting {
<#
.SYNOPSIS
Used by As Built Report to retrieve Veeam VB365 Office365 Exchange Connection Settings
.DESCRIPTION
Documents the configuration of Veeam VB365 in Word/HTML/Text formats using PScribo.
.NOTES
Version: 0.2.0
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Credits: Iain Brighton (@iainbrighton) - PScribo module
.LINK
https://github.com/AsBuiltReport/AsBuiltReport.Veeam.VB365
#>
[CmdletBinding()]
param (
[Parameter(
Position = 0,
Mandatory = $true
)]
[ValidateNotNullOrEmpty()]
[String] $Organization
)

begin {
Write-PScriboMessage "Organizations InfoLevel set at $($InfoLevel.Infrastructure.Organization)."
}

process {
try {
$Organizations = Get-VBOOrganization -Name $Organization
if (($InfoLevel.Infrastructure.Organization -gt 0) -and ($Organizations.Office365ExchangeConnectionSettings)) {
Write-PscriboMessage "Collecting Veeam VB365 Office365 Exchange Connection Settings."
Section -Style Heading4 'Exchange Connection Setting' {
$OrganizationInfo = @()
foreach ($Org in $Organizations.Office365ExchangeConnectionSettings) {
$inObj = [ordered] @{
'Application Id' = $Org.ApplicationId
'Authentication Type' = $Org.AuthenticationType
'Impersonation Account Name' = $Org.ImpersonationAccountName
'Office Organization Name' = $Org.OfficeOrganizationName
'Configure Application' = ConvertTo-TextYN $Org.ConfigureApplication
'ApplicationCertificateThumbprint' = $Org.ApplicationCertificateThumbprint
'SharePoint Save All Web Parts' = ConvertTo-TextYN $Org.SharePointSaveAllWebParts
}

$OrganizationInfo += [PSCustomObject]$InObj
}

foreach ($Org in $OrganizationInfo) {
Section -ExcludeFromTOC -Style NOTOCHeading5 "$($Org.'Application Id')" {
$TableParams = @{
Name = "Application Id - $($Org.'Application Id')"
List = $true
ColumnWidths = 50, 50
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}

$Org| Table @TableParams
}
}
}
}
} catch {
Write-PscriboMessage -IsWarning "Office365 Exchange Connection Settings Section: $($_.Exception.Message)"
}
}

end {}
}
Loading

0 comments on commit e5462ae

Please sign in to comment.