Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved VB365 Diagram #17

Merged
merged 13 commits into from
Mar 10, 2024
7 changes: 4 additions & 3 deletions AsBuiltReport.Veeam.VB365.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
},
"Options": {
"BackupServerPort": 9191,
"EnableDiagrams": false,
"EnableDiagrams": true,
"EnableDiagramDebug": false,
"DiagramWaterMark": "",
"ExportDiagrams": false,
"EnableDiagramSignature": false,
"SignatureAuthorName": "Consultant Name",
"SignatureCompanyName": "Veeam Software"
"SignatureAuthorName": "",
"SignatureCompanyName": ""
},
"InfoLevel": {
"_comment_": "Please refer to the AsBuiltReport project contributing guide for information about how to define InfoLevels.",
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,16 @@ The **Report** schema provides configuration of the Veeam VB365 report informati

The **Options** schema allows certain options within the report to be toggled on or off.

| Sub-Schema | Setting | Default | Description |
| ------------------- | ---------- | ------- | ---------------------------------------------------------------- |
| BackupServerPort | TCP Port | 9191 | Used to specify the backup service's custom port. |
| EnableDiagrams | true/false | false | Toggle to enable/disable the creation of infrastructure diagram. |
| EnableDiagramsDebug | true/false | false | Toggle to enable/disable diagram debug option. |

| Sub-Schema | Setting | Default | Description |
| ---------------------- | ---------- | ------- | ---------------------------------------------------------------- |
| BackupServerPort | TCP Port | 9191 | Used to specify the backup service's custom port. |
| EnableDiagrams | true/false | true | Toggle to enable/disable the creation of infrastructure diagram. |
| EnableDiagramsDebug | true/false | false | Toggle to enable/disable diagram debug option. |
| DiagramWaterMark | string | empty | Used to set the diagram waterMark. |
| ExportDiagrams | true/false | false | Toggle to enable/disable diagram export option. |
| EnableDiagramSignature | true/false | false | Toggle to enable/disable diagram signature (button right corner) |
| SignatureAuthorName | string | empty | Toggle to set signature author name. |
| SignatureCompanyName | string | empty | Toggle to set signature company name. |

<!-- ********** Add/Remove the number of InfoLevels as required ********** -->
### InfoLevel
Expand Down
189 changes: 139 additions & 50 deletions Src/Private/Get-AbrVb365Diagram.ps1

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Src/Private/Get-AbrVb365OrganizationRestoreOperator.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function Get-AbrVb365OrganizationRestoreOperator {
process {
try {
$Organizations = Get-VBOOrganization -Name $Organization
$RestoreOperators = try { Get-VBORbacRole -Organization $Organizations | Sort-Object -Property Name} catch { Out-Null }
$script:RestoreOperators = try { Get-VBORbacRole -Organization $Organizations | Sort-Object -Property Name} catch { Out-Null }
if (($InfoLevel.Infrastructure.Organization -gt 0) -and ($RestoreOperators)) {
Write-PScriboMessage "Collecting Veeam VB365 Office365 Restore Operators Settings."
Section -Style Heading4 'Restore Operators' {
Expand Down
27 changes: 13 additions & 14 deletions Src/Private/Get-AbrVb365ServerRestAPI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ function Get-AbrVB365ServerRestAPI {

process {
try {
$ServerConfig = Get-VBORestAPISettings
if (($InfoLevel.Infrastructure.ServerConfig -gt 0) -and ($ServerConfig)) {
$script:ServerConfigRestAPI = Get-VBORestAPISettings
if (($InfoLevel.Infrastructure.ServerConfig -gt 0) -and ($ServerConfigRestAPI)) {
Write-PScriboMessage "Collecting Veeam VB365 RESTful API."
Section -Style Heading3 'RESTful API' {
$ServerConfigInfo = @()
$ServerConfigRestAPIInfo = @()
$inObj = [ordered] @{
'Is Service Enabled' = ConvertTo-TextYN $ServerConfig.IsServiceEnabled
'Auth Token LifeTime' = ConvertTo-EmptyToFiller $ServerConfig.AuthTokenLifeTime
'HTTPS Port' = ConvertTo-EmptyToFiller $ServerConfig.HTTPSPort
'Cert Friendly Name' = ConvertTo-EmptyToFiller $ServerConfig.CertificateFriendlyName
'Issued To' = ConvertTo-EmptyToFiller $ServerConfig.CertificateIssuedTo
'Issued By' = ConvertTo-EmptyToFiller $ServerConfig.CertificateIssuedBy
'Thumbprint' = $ServerConfig.CertificateThumbprint
'Expiration Date' = ConvertTo-EmptyToFiller $ServerConfig.CertificateExpirationDate
'Is Service Enabled' = ConvertTo-TextYN $ServerConfigRestAPI.IsServiceEnabled
'Auth Token LifeTime' = ConvertTo-EmptyToFiller $ServerConfigRestAPI.AuthTokenLifeTime
'HTTPS Port' = ConvertTo-EmptyToFiller $ServerConfigRestAPI.HTTPSPort
'Cert Friendly Name' = ConvertTo-EmptyToFiller $ServerConfigRestAPI.CertificateFriendlyName
'Issued To' = ConvertTo-EmptyToFiller $ServerConfigRestAPI.CertificateIssuedTo
'Issued By' = ConvertTo-EmptyToFiller $ServerConfigRestAPI.CertificateIssuedBy
'Thumbprint' = $ServerConfigRestAPI.CertificateThumbprint
'Expiration Date' = ConvertTo-EmptyToFiller $ServerConfigRestAPI.CertificateExpirationDate
}
$ServerConfigInfo = [PSCustomObject]$InObj
$ServerConfigRestAPIInfo = [PSCustomObject]$InObj

$TableParams = @{
Name = "RESTful API - $VeeamBackupServer"
Expand All @@ -49,13 +49,12 @@ function Get-AbrVB365ServerRestAPI {
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$ServerConfigInfo | Table @TableParams
$ServerConfigRestAPIInfo | Table @TableParams
}
}
} catch {
Write-PScriboMessage -IsWarning "RESTful API Section: $($_.Exception.Message)"
}
}

end {}
}
2 changes: 1 addition & 1 deletion Src/Private/Get-AbrVb365ServerRestorePortal.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function Get-AbrVb365ServerRestorePortal {

process {
try {
$RestorePortal = Get-VBORestorePortalSettings
$script:RestorePortal = Get-VBORestorePortalSettings
if (($InfoLevel.Infrastructure.ServerConfig -gt 0) -and ($RestorePortal)) {
Write-PScriboMessage "Collecting Veeam VB365 restore portal."
Section -Style Heading3 'Restore Portal' {
Expand Down
46 changes: 45 additions & 1 deletion Src/Private/SharedUtilsFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,48 @@ function Get-ColumnChart {

return $Base64Image

} # end
} # end

# Used for debugging
function Get-VB365DebugObject {

[CmdletBinding()]
param (
)

$script:RestoreOperators = @{
Name = "RestoreOperators1", "RestoreOperators2", "RestoreOperators3", "RestoreOperators4", "RestoreOperators5", "RestoreOperators6", "RestoreOperators7"
}

$script:Proxies = @{
HostName = "Proxy1", "Proxy2", "Proxy3", "Proxy4", "Proxy5", "Proxy6", "Proxy7"
}

$script:RestorePortal = @{
IsServiceEnabled = $true
PortalUri = "https://publicurl.internet.com:4443"
}

$script:Repositories = @{
Name = "Repository1", "Repository2", "Repository3", "Repository4", "Repository5", "Repository6", "Repository7"
}


$script:ObjectRepositories = @{
Name = "ObjectRepositor1", "ObjectRepositor2", "ObjectRepositor3", "ObjectRepositor4", "ObjectRepositor5", "ObjectRepositor6", "ObjectRepositor7"
}

$script:Organizations = @()
$inOrganizationOffice365Obj = [ordered] @{
Name = "ObjectRepositor1","ObjectRepositor2","ObjectRepositor3","ObjectRepositor7","ObjectRepositor8","ObjectRepositor9"
Type = "Office365"
}

$inOrganizationOnPremisesObj = [ordered] @{
Name = "ObjectRepositor4","ObjectRepositor5","ObjectRepositor6","ObjectRepositor10","ObjectRepositor11","ObjectRepositor12"
Type = "OnPremises"
}

$Organizations += [PSCustomObject]$inOrganizationOffice365Obj
$Organizations += [PSCustomObject]$inOrganizationOnPremisesObj
}
9 changes: 9 additions & 0 deletions Src/Public/Invoke-AsBuiltReport.Veeam.VB365.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ function Invoke-AsBuiltReport.Veeam.VB365 {
Write-PScriboMessage -IsWarning "Unable to export the Infrastructure Diagram: $($_.Exception.Message)"
}

if ($Graph) {
If ((Get-DiaImagePercent -ImageInput $Graph.FullName).Width -gt 1500) { $ImagePrty = 20 } else { $ImagePrty = 50 }
Section -Style Heading3 "Infrastructure Diagram." {
Image -Path $Graph.FullName -Text "Veeam Backup for Microsoft 365 Diagram" -Percent $ImagePrty -Align Center
Paragraph "Image preview: Opens the image in a new tab to view it at full resolution." -Tabs 2
}
BlankLine
}

} else {
try {
try {
Expand Down
Binary file removed icons/User Group.png
Binary file not shown.
Binary file modified icons/User.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/User_Group.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed icons/Web console.png
Binary file not shown.
Binary file added icons/Web_console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.