diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..b735373 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,35 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..066b2d9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,17 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..b6b1e17 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,34 @@ + + +## Description + + +## Related Issue + + + + + +## Motivation and Context + + +## How Has This Been Tested? + + + + +## Screenshots (if appropriate): + +## Types of changes + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) + +## Checklist: + + +- [ ] My code follows the code style of this project. +- [ ] My change requires a change to the documentation. +- [ ] I have updated the documentation accordingly. +- [ ] I have read the [**CONTRIBUTING**](/CONTRIBUTING.md) document. diff --git a/.github/workflows/PSScriptAnalyzer.yml b/.github/workflows/PSScriptAnalyzer.yml new file mode 100644 index 0000000..fe69d8f --- /dev/null +++ b/.github/workflows/PSScriptAnalyzer.yml @@ -0,0 +1,17 @@ +name: PSScriptAnalyzer +on: [push, pull_request] +jobs: + lint: + name: Run PSScriptAnalyzer + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: lint + uses: devblackops/github-action-psscriptanalyzer@master + with: + sendComment: true + failOnErrors: true + failOnWarnings: false + failOnInfos: false + repoToken: ${{ secrets.GITHUB_TOKEN }} + settingsPath: .github/workflows/PSScriptAnalyzerSettings.psd1 \ No newline at end of file diff --git a/.github/workflows/PSScriptAnalyzerSettings.psd1 b/.github/workflows/PSScriptAnalyzerSettings.psd1 new file mode 100644 index 0000000..c053761 --- /dev/null +++ b/.github/workflows/PSScriptAnalyzerSettings.psd1 @@ -0,0 +1,8 @@ +@{ + ExcludeRules = @( + 'PSUseToExportFieldsInManifest', + 'PSReviewUnusedParameter', + 'PSUseDeclaredVarsMoreThanAssignments', + 'PSAvoidGlobalVars' + ) +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c133455 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,25 @@ +{ + "powershell.codeFormatting.preset": "Custom", + "powershell.codeFormatting.useCorrectCasing": true, + "powershell.codeFormatting.autoCorrectAliases": true, + "powershell.codeFormatting.whitespaceBeforeOpenBrace": true, + "powershell.codeFormatting.whitespaceBeforeOpenParen": true, + "powershell.codeFormatting.whitespaceAroundOperator": true, + "powershell.codeFormatting.whitespaceAfterSeparator": true, + "powershell.codeFormatting.addWhitespaceAroundPipe": true, + "powershell.codeFormatting.ignoreOneLineBlock": true, + "powershell.codeFormatting.newLineAfterCloseBrace": false, + "powershell.codeFormatting.newLineAfterOpenBrace": true, + "powershell.codeFormatting.openBraceOnSameLine": true, + "powershell.codeFormatting.alignPropertyValuePairs": false, + "powershell.codeFolding.enable": true, + "powershell.scriptAnalysis.enable": true, + "powershell.scriptAnalysis.settingsPath": ".github/workflows/PSScriptAnalyzerSettings.psd1", + "editor.tabSize": 4, + "editor.insertSpaces": true, + "editor.detectIndentation": false, + "editor.rulers": [ + 115 + ], + "files.trimTrailingWhitespace": true +} \ No newline at end of file diff --git a/AsBuiltReport.Rubrik.CDM.Style.ps1 b/AsBuiltReport.Rubrik.CDM.Style.ps1 index 75dda73..d1890cc 100644 --- a/AsBuiltReport.Rubrik.CDM.Style.ps1 +++ b/AsBuiltReport.Rubrik.CDM.Style.ps1 @@ -7,13 +7,16 @@ DocumentOption -EnableSectionNumbering -PageSize A4 -DefaultFont 'Arial' -Margin Style -Name 'Title' -Size 24 -Color '00B388' -Align Center Style -Name 'Title 2' -Size 18 -Color '00A3E0' -Align Center Style -Name 'Title 3' -Size 12 -Color '00A3E0' -Align Left -Style -Name 'Heading 1' -Size 16 -Color '00A3E0' -Style -Name 'Heading 2' -Size 14 -Color '00A3E0' -Style -Name 'Heading 3' -Size 12 -Color '00A3E0' -Style -Name 'Heading 4' -Size 11 -Color '00A3E0' +Style -Name 'Heading 1' -Size 16 -Color '00A3E0' +Style -Name 'Heading 2' -Size 14 -Color '00A3E0' +Style -Name 'Heading 3' -Size 12 -Color '00A3E0' +Style -Name 'Heading 4' -Size 11 -Color '00A3E0' Style -Name 'Heading 5' -Size 10 -Color '00A3E0' Style -Name 'Normal' -Size 10 -Color '00313C' -Default -Style -Name 'TOC' -Size 16 -Color '00A3E0' +Style -Name 'Caption' -Size 10 -Color '00313C' -Italic -Align Center +Style -Name 'Header' -Size 10 -Color '00313C' -Align Center +Style -Name 'Footer' -Size 10 -Color '00313C' -Align Center +Style -Name 'TOC' -Size 16 -Color '00A3E0' Style -Name 'TableDefaultHeading' -Size 10 -Color 'FAFAFA' -BackgroundColor '00B388' Style -Name 'TableDefaultRow' -Size 10 -Color '00313C' Style -Name 'Critical' -Size 10 -BackgroundColor 'F5DBD9' @@ -28,6 +31,8 @@ $TableDefaultProperties = @{ RowStyle = 'TableDefaultRow' BorderColor = '00B388' Align = 'Left' + CaptionStyle = 'Caption' + CaptionLocation = 'Below' BorderWidth = 0.25 PaddingTop = 1 PaddingBottom = 1.5 @@ -36,18 +41,36 @@ $TableDefaultProperties = @{ } TableStyle @TableDefaultProperties -Default -TableStyle -Id 'Borderless' -BorderWidth 0 +TableStyle -Id 'Borderless' -HeaderStyle Normal -RowStyle Normal -BorderWidth 0 + +# Rubrik Cover Page Layout +# Header & Footer +if ($ReportConfig.Report.ShowHeaderFooter) { + Header -Default { + Paragraph -Style Header "$($ReportConfig.Report.Name) - v$($ReportConfig.Report.Version)" + } + + Footer -Default { + Paragraph -Style Footer 'Page ' + } +} -# Cover Page Layout # Set position of report titles and information based on page orientation +if (!($ReportConfig.Report.ShowCoverPageImage)) { + $LineCount = 5 +} if ($Orientation -eq 'Portrait') { BlankLine -Count 11 - $LineCount = 30 + $LineCount = 32 + $LineCount } else { BlankLine -Count 7 - $LineCount = 20 + $LineCount = 15 + $LineCount } +# Rubrik are Logo Image +if ($ReportConfig.Report.ShowCoverPageImage) { + Image -Text 'Rubrik Logo' -Align 'Center' -Percent 40 -Base64 "iVBORw0KGgoAAAANSUhEUgAAAlsAAADjCAYAAACyw9FAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAIqdJREFUeNrs3X9wG9dh4PH38IOUrF+Q4iRtnYsg/1SbNIY6nfQ/E0g7jmWZMZmkSd1JYqC9tE47HVGTpuN2OhU5vek5dXOipnPN3PVartK0TuI4ok3b+nGeANT9lbtrxKRJ49hOBMVJ+sO/GFuyLPEH+t5ilwApENwFdhcPwPeTwAQpEAQXS+wXD4u3QgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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7H3zIsEFwCA2EKgsl5Dy89xb168c2/h1Yt1LymKTo5oiY1Cy/0ZeoRrjFUCAEBsIUBy3nto+TvM4IsHasHVBaEFAACxhVBYC4uVaX/HOvQTXLcUXlszwmVwaOnrtVglAADEFoJzz7vn/+X2zKiOGBUi00GGluuFAzfXvaTYidCSG4VWWZ0m1GnP07ddW2alAAB0O16zMdju4rfS6i46rM7mGx2Cp5zb2/L99+YnnpvaviWRj3pE69qZH1Wu3THQaDW0I0sFlsU9DwDoJYxsGex87p3l87l3FFSK7FFBYlX36VqJnnI71/3CgRudlxSjfekwEZdrYkrq6yyoyNpDaAEAehEjW10kXfxOSt1lejRKT4lgncvtLbd7nW954ntT27cm81GElmvvmRf0z0ur6y2pwCpxzwIAiC30tLc88X0VXPolxfBDCwCAfsPLiBD/fuD6wqsX1n2XIqEFAACxhfaDa09hYbFySFSnXHBDq0RoAQDQHl5GxCo3zf5Q7xemZ2+ff3boujmWCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0yn8IMAA6TRFgb+/AKQAAAABJRU5ErkJggg==" +} # Add Report Name Paragraph -Style Title $ReportConfig.Report.Name @@ -65,6 +88,8 @@ Table -Name 'Cover Page' -List -Style Borderless -Width 0 -Hashtable ([Ordered] }) PageBreak -# Add Table of Contents -TOC -Name 'Table of Contents' -PageBreak \ No newline at end of file +if ($ReportConfig.Report.ShowTableOfContents) { + # Add Table of Contents + TOC -Name 'Table of Contents' + PageBreak +} \ No newline at end of file diff --git a/AsBuiltReport.Rubrik.CDM.json b/AsBuiltReport.Rubrik.CDM.json index 1fb98a9..0c89432 100644 Binary files a/AsBuiltReport.Rubrik.CDM.json and b/AsBuiltReport.Rubrik.CDM.json differ diff --git a/AsBuiltReport.Rubrik.CDM.psd1 b/AsBuiltReport.Rubrik.CDM.psd1 index facdad6..a77e584 100644 Binary files a/AsBuiltReport.Rubrik.CDM.psd1 and b/AsBuiltReport.Rubrik.CDM.psd1 differ diff --git a/AsBuiltReport.Rubrik.CDM.psm1 b/AsBuiltReport.Rubrik.CDM.psm1 index 999818e..22453b3 100644 --- a/AsBuiltReport.Rubrik.CDM.psm1 +++ b/AsBuiltReport.Rubrik.CDM.psm1 @@ -1,7 +1,8 @@ -# Get public function definition files and dot source them -$Public = @(Get-ChildItem -Path $PSScriptRoot\Src\Public\*.ps1) +# Get public and private function definition files and dot source them +$Public = @(Get-ChildItem -Path $PSScriptRoot\Src\Public\*.ps1 -ErrorAction SilentlyContinue) +$Private = @(Get-ChildItem -Path $PSScriptRoot\Src\Private\*.ps1 -ErrorAction SilentlyContinue) -foreach ($Module in $Public) { +foreach ($Module in @($Public + $Private)) { try { . $Module.FullName } catch { @@ -10,3 +11,4 @@ foreach ($Module in $Public) { } Export-ModuleMember -Function $Public.BaseName +Export-ModuleMember -Function $Private.BaseName diff --git a/CHANGELOG.md b/CHANGELOG.md index 4015880..5ef19bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,45 @@ # Rubrik CDM As Built Report Changelog +## [1.0.1] + +### Added + +* Added null check on SMB Domain information +* Added null check on Syslog Information +* Added null check on Guest OS Credentials Information + +### Modified + +* Modified null check on VMware VMs protected objects section as it was trying to index a null array + +## [1.0.0] - 2021-01-29 + +### Added +* Added report style options to report configuration JSON + +### Modified + +* Modified default style to include headers, footers, table captions and cover page logo +* Removed and replaced references of `Write-Verbose` with `Write-PScriboMessage` +* Increased version in changelog and manifest + +## [0.0.9] - 2020-09-04 + +### Modified + +* Added null checks to replication source and targets before outputing as per [Issue 10](https://github.com/AsBuiltReport/AsBuiltReport.Rubrik.CDM/issues/10) +* Added S3Compatible as archive type as per [Issue 11](https://github.com/AsBuiltReport/AsBuiltReport.Rubrik.CDM/issues/11) +* Increases version in changelog and manifest. + +## [0.0.8] - 2020-07-30 + +### Modified + +* Added count check on Snapshot retention +* Removed duplicate Object cmd on vCloud Director section +* Count checks now occur on both Filesets and NAS Shares before issuing -DetailedObject queries. Fixes [Issue 6](https://github.com/AsBuiltReport/AsBuiltReport.Rubrik.CDM/issues/6) +* Added more verbose logging around what versions of modules are installed + ## [0.0.7] - 2020-04-17 ### Modified diff --git a/README.md b/README.md index b756840..a7d7fa5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,27 @@ +

+ + + + + + +

+

+ + + + + + +

+

+ + +

+ # Rubrik CDM As Built Report -## Sample Reports +## :books: Sample Reports ### Sample Report 1 - Default Style @@ -14,11 +35,14 @@ Sample Rubrik report using custom report styles ![](Samples/Rubrik-Report-2.png) -# Getting Started +# :beginner: Getting Started Below are the instructions on how to install, configure, and generate a Rubrik CDM As Built report. -## Pre-requisites +## :floppy_disk: Supported Versions +* To be added + +## :wrench: System Requirements The following PowerShell modules are required for generating a Rubrik As Built report. @@ -27,9 +51,12 @@ Each of these modules can be easily downloaded and installed via the PowerShell - [Rubrik CDM Powershell SDK](https://www.powershellgallery.com/packages/Rubrik/) - [AsBuiltReport Module](https://www.powershellgallery.com/packages/AsBuiltReport/) -### Module Installation +### :closed_lock_with_key: Required Privileges -#### Installing the Rubrik SDK for PowerShell +In order to generate a Rubrik CDM As Built Report, user credentials with the administrator role are required. The use of non-administrative credentials may produce incomplete results. +## :package: Module Installation + +### Installing the Rubrik SDK for PowerShell 1. Ensure you have the Windows Management Framework 5.0 or greater installed. 1. Open a Powershell console with the Run as Administrator option. @@ -37,7 +64,7 @@ Each of these modules can be easily downloaded and installed via the PowerShell 1. Run `Install-Module -Name Rubrik -Scope CurrentUser` to download the module from the PowerShell Gallery. Note that the first time you install from the remote repository it may ask you to first trust the repository. 1. Alternatively `Install-Module -Name Rubrik -Scope AllUsers` can be execute be used if you would like to install the module for all users on the current system. -#### Installing the As Built Report Module +### Installing the As Built Report Module Installing the As Built Report core module with the below instructions takes care of installing all of subsidiary reports, including the Rubrik CDM core report. @@ -53,11 +80,7 @@ Install-Module -Name AsBuiltReport.Vendor.Product e.g. Install-Module -Name AsBuiltReport.Rubrik.CDM ``` -### Required Privileges - -In order to generate a Rubrik CDM As Built Report, user credentials with the administrator role are required. The use of non-administrative credentials may produce incomplete results. - -### Configuration +## :pencil2: Configuration The Rubrik CDM As Built Report utilises a JSON file to allow configuration of report information, options, detail and healthchecks. @@ -76,11 +99,15 @@ The following provides information of how to configure each schema within the re The **Report** sub-schema provides configuration of the vSphere report information -| Schema | Sub-Schema | Description | -| ------ | ---------- | ----------- | -| Report | Name | The name of the As Built Report -| Report | Version | The report version -| Report | Status | The report release status +| Sub-Schema | Setting | Default | Description | +|---------------------|--------------|----------------------------|--------------------------------------------------------------| +| Name | User defined | Rubrik CDM As Built Report | The name of the As Built Report | +| Version | User defined | 1.0 | The report version | +| Status | User defined | Released | The report release status | +| ShowCoverPageImage | true / false | true | Toggle to enable/disable the display of the cover page image | +| ShowTableOfContents | true / false | true | Toggle to enable/disable table of contents | +| ShowHeaderFooter | true / false | true | Toggle to enable/disable document headers & footers | +| ShowTableCaptions | true / false | true | Toggle to enable/disable table captions/numbering | ### Options @@ -92,49 +119,50 @@ Currently the Rubrik CDM As Built Report does not utlize this section. The **InfoLevel** sub-schema allows configuration of each section of the report at a granular level. The following sections can be set -| Schema | Sub-Schema | Default Setting | -| ------ | ---------- | --------------- | -| InfoLevel | Cluster | 3 -| InfoLevel | SLADomains | 3 -| InfoLevel | ProtectedObjects | 3 -| InfoLevel | SnapshotRetention | 3 - There are 4 levels (0/1/3/5) of detail granularity for each section as follows; -| Setting | InfoLevel | Description | -| ------- | ---- | ----------- | -| 0 | Disabled | does not collect or display any information -| 1 | Summary | provides summarized information for a collection of objects -| 2 | Unused | reserved for future use -| 3 | Detailed | provides detailed information for individual objects -| 4 | Unused | reserved for future use -| 5 | Comprehensive | provides comprehensive information for individual objects, such as advanced configuration settings +| Setting | InfoLevel | Description | +|---------|---------------|----------------------------------------------------------------------------------------------------| +| 0 | Disabled | Does not collect or display any information | +| 1 | Summary | Provides summarized information for a collection of objects | +| 2 | Unused | Reserved for future use | +| 3 | Detailed | Provides detailed information for individual objects | +| 4 | Unused | Reserved for future use | +| 5 | Comprehensive | Provides comprehensive information for individual objects, such as advanced configuration settings | ***Note*** While you can specify InfoLevels of 2 and 4, they will simply default to the closest defined level below them. IE 2 becomes 1 and 4 becomes 3. +The table below outlines the default and maximum **InfoLevel** settings for each section. + +| Sub-Schema | Default Setting | Maximum Setting | +|-------------------|-----------------|:---------------:| +| Cluster | 3 | | +| SLADomains | 3 | | +| ProtectedObjects | 3 | | +| SnapshotRetention | 3 | | ### Healthchecks The `Healthcheck` section of the Rubrik CDM As Built Report is not currently utilized. -## Examples +## :computer: Examples - Generate HTML & Word reports with Timestamp Generate a Rubrik CDM As Built Report for a cluster named 'cluster1.domain.local' using specified credentials. Export report to HTML & DOCX formats. Use default report style. Append timestamp to report filename. Save reports to 'C:\Reports\' ```powershell - New-AsBuiltReport -Target 'cluster1.domain.local' -Username 'administrator@domain.local' -Password 'SuperSecret' -Report Rubrik.CDM -Format Html,Word -OutputPath 'C:\Reports' -Timestamp + New-AsBuiltReport -Target 'cluster1.domain.local' -Username 'administrator@domain.local' -Password 'SuperSecret' -Report Rubrik.CDM -Format Html,Word -OutputFolderPath 'C:\Reports' -Timestamp ``` - Generate HTML & Text reports Generate a Rubrik CDM As Built Report for a cluster named 'cluster1.domain.local' using stored credentials. Export report to HTML & Text formats. Use default report style. Save reports to 'C:\Reports' ```powershell - New-AsBuiltReport -Target 'cluster1.domain.local' -Credential $Creds -Report Rubrik.CDM -Format Html,Text -OutputPath 'C:\Reports' + New-AsBuiltReport -Target 'cluster1.domain.local' -Credential $Creds -Report Rubrik.CDM -Format Html,Text -OutputFolderPath 'C:\Reports' ``` - Generate report with multiple Rubrik cluster using Custom Style Generate a single Rubrik CDM As Built Report for clusters 'cluster1.domain.local' and 'cluster2.domain.org' using specified credentials. Report exports to WORD format by default. Apply custom style to the report. Reports are saved to the user profile folder by default. ```powershell - New-AsBuiltReport -Target 'cluster1.domain.local','cluster2.domain.org' -Username 'administrator@domain.local' -Password 'SuperSecret' -Report Rubrik.CDM -StylePath C:\Scripts\Styles\MyCustomStyle.ps1 + New-AsBuiltReport -Target 'cluster1.domain.local','cluster2.domain.org' -Username 'administrator@domain.local' -Password 'SuperSecret' -Report Rubrik.CDM -StyleFilePath C:\Scripts\Styles\MyCustomStyle.ps1 ``` ***Note*** the Username/Password combiniation or credentials being passed/used must have administrative rights on both the `cluster1.domain.local` and `cluster2.domain.local` domains. @@ -142,20 +170,20 @@ The `Healthcheck` section of the Rubrik CDM As Built Report is not currently uti Generate a Rubrik CDM As Built Report for the cluster named 'cluster1.domain.local' using specified credentials. Export report to HTML & DOC formats. Use default report style. Reports are saved to the user profile folder by default. Attach and send reports via e-mail. ```powershell - New-AsBuiltReport -Target 'cluster1.domain.local' -Username 'administrator@domain.local' -Password 'domain.local' -Report Rubrik.CDM -Format Html,Word -OutputPath C:\Reports -SendEmail + New-AsBuiltReport -Target 'cluster1.domain.local' -Username 'administrator@domain.local' -Password 'domain.local' -Report Rubrik.CDM -Format Html,Word -OutputFolderPath C:\Reports -SendEmail ``` - Generate Word reports using the generated JSON config ```powershell - New-AsBuiltReport -Report Rubrik.CDM -Target -Credential (Import-CliXML -Path ) -Format Word -Orientation Portrait -OutputPath -ReportConfigPath -AsBuiltConfigPath + New-AsBuiltReport -Report Rubrik.CDM -Target -Credential (Import-CliXML -Path ) -Format Word -Orientation Portrait -OutputFolderPath -ReportConfigFilePath -AsBuiltConfigFilePath ``` - Generate Word reports using the generated JSON config, along with verbose logging ```powershell - New-AsBuiltReport -Report Rubrik.CDM -Target -Credential (Import-CliXML -Path ) -Format Word -Orientation Portrait -OutputPath -ReportConfigPath -AsBuiltConfigPath -Verbose + New-AsBuiltReport -Report Rubrik.CDM -Target -Credential (Import-CliXML -Path ) -Format Word -Orientation Portrait -OutputFolderPath -ReportConfigFilePath -AsBuiltConfigFilePath -Verbose ``` -## Known Issues +## :exclamation: Known Issues - InfoLevel 3 and above causes "User Not Found" messages to be displayed on the console. - While not a show stopper, when running the Rubrik CDM As Built Report with Cluster Info Level of 3 or higher User not found messages are shown in the console. This is the result of Rubrik trying to query deeper information about users who no longer have an LDAP Account within the system. Reports continue to generate regardless of the error shown. \ No newline at end of file diff --git a/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 b/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 index bb70ad2..980d1a4 100644 --- a/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 +++ b/Src/Public/Invoke-AsBuiltReport.Rubrik.CDM.ps1 @@ -5,7 +5,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { .DESCRIPTION Documents the configuration of the Rubrik CDM in Word/HTML/XML/Text formats using PScribo. .NOTES - Version: 0.0.7 + Version: 1.0.1 Author: Mike Preston Twitter: @mwpreston Github: mwpreston @@ -42,23 +42,29 @@ function Invoke-AsBuiltReport.Rubrik.CDM { #---------------------------------------------------------------------------------------------# # SCRIPT BODY # #---------------------------------------------------------------------------------------------# + $CDMAsBuiltModule = Get-Module -Name "AsBuiltReport.Rubrik.CDM" + $AsBuiltModule = Get-Module -Name "AsBuiltReport.Core" + $RubrikModule = Get-Module -Name "Rubrik" + Write-PScriboMessage -Message "[Rubrik] [Info] As Built Report Core Module is version $($AsBuiltModule.Version) from $($AsBuiltModule.RepositorySourceLocation)" + Write-PScriboMessage -Message "[Rubrik] [Info] As Built Rubrik Module is version $($CDMAsBuiltModule.Version) from $($CDMAsBuiltModule.RepositorySourceLocation)" + Write-PScriboMessage -Message "[Rubrik] [Info] Rubrik Module is version $($RubrikModule.Version) from $($RubrikModule.RepositorySourceLocation)" foreach ($brik in $Target) { try { - Write-Verbose -Message "[Rubrik] [$($brik)] [Connection] Connecting to $($brik)" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Connection] Connecting to $($brik)" $RubrikCluster = Connect-Rubrik -Server $brik -Credential $Credential -ErrorAction Stop } catch { Write-Error $_ } if ($RubrikCluster) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Rubrik Cluster Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Rubrik Cluster Settings" $ClusterInfo = Get-RubrikClusterInfo Section -Style Heading1 $($ClusterInfo.Name) { if ($InfoLevel.Cluster -ge 1) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Beginning Cluster Settings Section with Info Level $($InfoLevel.Cluster)" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Beginning Cluster Settings Section with Info Level $($InfoLevel.Cluster)" Section -Style Heading2 'Cluster Settings' { Paragraph ("The following section provides information on the configuration of the Rubrik CDM Cluster $($ClusterInfo.Name)") BlankLine - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving additional cluster settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving additional cluster settings" #Cluster Summary for InfoLevel 1/2 (Summary/Informative) $ClusterSummary = [ordered]@{ 'Name' = $ClusterInfo.Name @@ -90,11 +96,11 @@ function Invoke-AsBuiltReport.Rubrik.CDM { $banner = Get-RubrikLoginBanner $ClusterSummary.Add('Login Banner', $banner.loginBanner) } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Cluster Summary" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Cluster Summary" # Cluster Information Table [pscustomobject]$ClusterSummary | Table -Name $ClusterSummary.Name -ColumnWidths 30, 70 -List Section -Style Heading3 'Cluster Storage Details' { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Cluster Storage Details" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Cluster Storage Details" $StorageInfo = Get-RubrikClusterStorage $StorageSummary = [ordered]@{ 'Total Usable Storage (TB)' = $StorageInfo.TotalUsableStorageInTb @@ -111,16 +117,16 @@ function Invoke-AsBuiltReport.Rubrik.CDM { $StorageSummary.Add('Average Daily Growth (GB)', $StorageInfo.AverageGrowthPerDayInGb) $StorageSummary.Add('Estimated Runway (days)', $StorageInfo.EstimatedRunwayInDays) } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Cluster Storage Details" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Cluster Storage Details" [pscustomobject]$StorageSummary | Table -Name "Cluster Storage Details" -ColumnWidths 30, 70 -List } # Node Overview Table if ($InfoLevel.Cluster -ge 3) { Section -Style Heading3 'Member Nodes' { - Write-Verbose "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Cluster Node Details" + Write-PScriboMessage "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Cluster Node Details" $NodeInfo = Get-RubrikNode - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Cluster Node Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Cluster Node Information" $NodeInfo | Table -Name "Cluster Node Information" -ColumnWidths 25, 12, 12, 25, 25 -Columns brikId, id, status, supportTunnel -Headers 'Brik ID', 'ID', 'Status', 'Support Tunnel' } } # End InfoLevel -ge 3 @@ -129,15 +135,15 @@ function Invoke-AsBuiltReport.Rubrik.CDM { Section -Style Heading3 'Network Settings' { Paragraph "The following contains network related settings for the cluster" Section -Style Heading4 'Cluster Interfaces' { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Cluster Node Networking Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Cluster Node Networking Information" $NodeDetails = Get-RubrikClusterNetworkInterface | Select-Object -Property @{N = "Interface Name"; E = { $_.interfaceName } }, @{N = "Type"; E = { $_.interfaceType } }, @{N = "Node"; E = { $_.node } }, @{N = "IP Addresses"; E = { $_.ipAddresses } }, @{N = "Subnet Mask"; E = { $_.netmask } } - Write-Verbose "[Rubrik] [$($brik)] [Cluster Settings] Output Cluster Networking" + Write-PScriboMessage "[Rubrik] [$($brik)] [Cluster Settings] Output Cluster Networking" $NodeDetails | Table -Name 'Cluster Node Information' } - Write-Verbose "[Rubrik] [$($brik)] [Cluster Settings] Output Cluster DNS" + Write-PScriboMessage "[Rubrik] [$($brik)] [Cluster Settings] Output Cluster DNS" Section -Style Heading4 'DNS Configuration' { $DNSDetails = Get-RubrikDNSSetting $DNSDetails = [ordered]@{ @@ -147,13 +153,13 @@ function Invoke-AsBuiltReport.Rubrik.CDM { [pscustomobject]$DNSDetails | Table -Name 'DNS Configuration' -List } if ($InfoLevel.Cluster -lt 3) { - Write-Verbose "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Cluster DNS Information" + Write-PScriboMessage "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Cluster DNS Information" $NTPDetails = Get-RubrikNTPServer | Select-Object -Property @{Name = "Server"; Expression = { $_.server } } $NetworkThrottleDetails = Get-RubrikNetworkThrottle | Select-Object -Property @{Name = "Resource ID"; Expression = { $_.resourceId } }, @{Name = "Enabled"; Expression = { $_.isEnabled } }, @{Name = "Default Throttle Limit"; Expression = { $_.defaultthrottleLimit } } } else { - Write-Verbose "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Cluster NTP Configuration" + Write-PScriboMessage "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Cluster NTP Configuration" $NTPServers = Get-RubrikNTPServer $NTPDetails = @() foreach ($ntpserver in $NTPServers) { @@ -165,7 +171,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } $NTPDetails += [pscustomobject]$inObj } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Network Throttling Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Network Throttling Information" $NetworkThrottleDetails = @() $NetworkThrottles = Get-RubrikNetworkThrottle foreach ($throttle in $NetworkThrottles) { @@ -189,20 +195,20 @@ function Invoke-AsBuiltReport.Rubrik.CDM { $NetworkThrottleDetails += [pscustomobject]$inObj } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output NTP Configuration" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output NTP Configuration" Section -Style Heading4 'NTP Configuration' { $NTPDetails | Table -Name 'NTP Configuration' } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Network Throttling" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Network Throttling" Section -Style Heading4 'Network Throttling' { $NetworkThrottleDetails | Table -Name 'Network Throttling' } Section -Style Heading4 'Proxy Server' { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Proxy Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Proxy Information" $ProxyDetails = Get-RubrikProxySetting if (0 -ne ($ProxyDetails | Measure-Object).count) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Proxy Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Proxy Settings" $ProxyDetails | Table -Name 'Proxy Configuration' } else { Paragraph "There are currently no proxy servers configured on this cluster" } } @@ -212,16 +218,16 @@ function Invoke-AsBuiltReport.Rubrik.CDM { Paragraph "The following contains notification settings configured on the cluster" Section -Style Heading4 'Email Settings' { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Email Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Email Information" $EmailDetails = Get-RubrikEmailSetting if (0 -ne ($EmailDetails | Measure-Object).count ) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Email Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Email Settings" $EmailDetails | Table -Name 'Email Details' } else { Paragraph "There are currently no email settings configured on this cluster" } } Section -Style Heading4 'SNMP Settings' { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving SNMP Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving SNMP Information" $SNMPInfo = Get-RubrikSNMPSetting $inObj = [ordered]@{ 'Community String' = $($SNMPInfo.communityString) @@ -236,16 +242,16 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } $inObj.add('Receiver Configurations', $strTraps) $SNMPDetails = [pscustomobject]$inObj - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output SNMP Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output SNMP Settings" $SNMPDetails | Table -Name 'SNMP Settings' } Section -Style Heading4 'Notification Settings' { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Notification Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Notification Settings" $NotificationDetails = Get-RubrikNotificationSetting | Select-Object -Property @{N = "ID"; E = { $_.id } }, @{N = "Event Types"; E = { $_.eventTypes | Out-String } }, @{N = "SNMP Addresses"; E = { $_.snmpAddresses } }, @{N = "Email Addresses"; E = { $_.emailAddresses } }, @{N = "Send to syslog"; E = { $_.shouldSendToSyslog } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Notification Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Notification Settings" $NotificationDetails | Table -Name 'Notification Settings' } } # End Heading 3 - NOtification Settings @@ -254,7 +260,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { Paragraph "The following contains security related settings configured on the cluster" Section -Style Heading4 'IPMI Settings' { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving IPMI Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving IPMI Information" $IPMIInformation = Get-RubrikIPMI $inObj = [ordered] @{ 'IPMI Available' = $IPMIInformation.isAvailable @@ -264,18 +270,18 @@ function Invoke-AsBuiltReport.Rubrik.CDM { 'Virtual Media Access' = $IPMIInformation.access.virtualMedia } $IPMIDetails = [pscustomobject]$inObj - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output IPMI Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output IPMI Settings" $IPMIDetails | Table -Name 'IPMI Settings' } Section -Style Heading4 'SMB Domains' { if ($InfoLevel.Cluster -in (1, 2)) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving SMB Domains" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving SMB Domains" $SMBDomainInformation = Get-RubrikSMBDomain | Select-Object @{Name = "Name"; Expression = { $_.name } }, @{Name = "Status"; Expression = { $_.status } }, @{Name = "Service Account"; Expression = { $_.serviceAccount } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving SMB Domains" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving SMB Domains" $SMBSecurityInformation = Get-RubrikSMBSecurity $SMBDomainInformation = Get-RubrikSMBDomain | Select-Object @{N = "Name"; E = { $_.name } }, @{N = "Status"; E = { $_.status } }, @@ -283,28 +289,39 @@ function Invoke-AsBuiltReport.Rubrik.CDM { @{N = "Sticky SMB Service"; E = { $_.isStickySmbService } }, @{Name = 'Force SMB Security'; Expression = { $SMBSecurityInformation.enforceSmbSecurity } } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output SMB Domains" - $SMBDomainInformation | Table -Name 'SMB Domains' + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output SMB Domains" + # Currently Get-RubrikSMBDomain has the possiblity of being null so we must check here + if ($null -eq $SMBDomainInformation) { + Paragraph "No SMB Domain information configured" + } + else { + $SMBDomainInformation | Table -Name 'SMB Domains' + } } Section -Style Heading4 'Syslog Settings' { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Syslog Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Syslog Information" $SyslogInformation = Get-RubrikSyslogServer | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, @{N = "Protocol"; E = { $_.protocol } }, @{N = "Port"; E = { $_.port } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Ouput Syslog Settings" - $SyslogInformation | Table -Name 'Syslog Settings' + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Ouput Syslog Settings" + if ($null -eq $SyslogInformation) { + Paragraph "No Syslog settings configured" + } else { + $SyslogInformation | Table -Name 'Syslog Settings' + } + } Section -Style Heading4 'Security Classification Settings' { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Security Classification Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Security Classification Settings" $SecurityInformation = Get-RubrikSecurityClassification | Select-Object -Property @{N = "Color"; E = { $_.classificationColor } }, @{N = "Message"; E = { $_.classificationMessage } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Security Classification Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Security Classification Settings" $SecurityInformation | Table -Name 'Security Classification Settings' -ColumnWidths 50, 50 } Section -Style Heading4 'User Details' { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving User Details" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving User Details" if ($InfoLevel.Cluster -in (1, 2)) { $UserDetails = Get-RubrikUser | Select-Object -Property @{N = "Username"; E = { $_.username } }, @{N = "First Name"; E = { $_.firstName } }, @{N = "Last Name"; E = { $_.lastName } }, @@ -326,25 +343,25 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } $UserDetails += [pscustomobject]$inObj } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output User Details" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output User Details" $UserDetails | Table -Name 'User Details' -ColumnWidths 20, 80 -List } } Section -Style Heading4 'LDAP Settings' { if ($InfoLevel.Cluster -in (1, 2)) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving LDAP Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving LDAP Settings" $LDAPDetails = Get-RubrikLDAP | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Domain Type"; E = { $_.domainType } }, @{N = "Initial Refresh Status"; E = { $_.initialRefreshStatus } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output LDAP Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output LDAP Settings" $LDAPDetails | Table -Name 'LDAP Settings' } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving LDAP Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving LDAP Settings" $LDAPDetails = Get-RubrikLDAP | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Domain Type"; E = { $_.domainType } }, @{N = "Initial Refresh Status"; E = { $_.initialRefreshStatus } }, @{N = "Dynamic DNS Name"; E = { $_.dynamicDnsName } }, @{N = "Service Account"; E = { $_.serviceAccount } }, @{N = "Bind Username"; E = { $_.bindUserName } }, @{Name = "Advanced Options"; Expression = { $_.advancedOptions | Out-String } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output LDAP Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output LDAP Settings" $LDAPDetails | Table -Name 'LDAP Settings' -ColumnWidths 20, 80 -List } } @@ -353,16 +370,21 @@ function Invoke-AsBuiltReport.Rubrik.CDM { Paragraph "The following contains backup related settings configured on the cluster" Section -Style Heading4 'Guest OS Credentials' { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Guest OS Credentials" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Guest OS Credentials" $GuestOSCredentials = Get-RubrikGuestOsCredential | Select-Object -Property @{N = "Username"; E = { $_.username } }, @{N = "Domain"; E = { $_.domain } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Guest OS Credentials" - $GuestOSCredentials | Table -Name 'Guest OS Credentials' -ColumnWidths 50, 50 + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Guest OS Credentials" + if ($null -eq $GuestOSCredentials) { + Paragraph "No Guest OS Credentials configured" + } else { + $GuestOSCredentials | Table -Name 'Guest OS Credentials' -ColumnWidths 50, 50 + } + } Section -Style Heading4 'Miscellaneous Backup Configurations' { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Miscellaneous Backup Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Miscellaneous Backup Settings" $BackupServiceDeployment = Get-RubrikBackupServiceDeployment | Select-Object @{Name = "Automatically Deploy RBS"; Expression = { $_.isAutomatic } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Miscellaneous Backup Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Miscellaneous Backup Settings" $BackupServiceDeployment | Table -Name 'Miscellaneous Backup Configuration' -ColumnWidths 30, 70 -List } } # End Heading 3 - Backup Settings @@ -377,70 +399,70 @@ function Invoke-AsBuiltReport.Rubrik.CDM { $LinuxHosts = Get-RubrikHost -PrimaryClusterId "local" -Type "Linux" } if ($InfoLevel.Cluster -lt 3) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving vCenter Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving vCenter Information" $VMwarevCenter = Get-RubrikvCenter -PrimaryClusterId "local" | Select-Object @{N = "Name"; E = { $_.name } }, @{N = "Hostname"; E = { $_.hostname } }, @{N = "Username"; E = { $_.username } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving vCloud Director Information" - $VMwareVCD = Get-RubrikVCD | Where-Object-Object { $_.PrimaryClusterId -eq (Get-RubrikSetting).id } | Select-Object @{N = "Name"; E = { $_.name } }, + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving vCloud Director Information" + $VMwareVCD = Get-RubrikVCD | Where-Object { $_.PrimaryClusterId -eq (Get-RubrikSetting).id } | Select-Object @{N = "Name"; E = { $_.name } }, @{N = "Hostname"; E = { $_.hostname } }, @{N = "Username"; E = { $_.username } }, @{Name = "Connection Status"; Expression = { $_.connectionStatus.status } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Nutanix Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Nutanix Information" if ($null -ne $NutanixClusters -and 0 -ne $NutanixClusters[0].total) { $NutanixClusters = Get-RubrikNutanixCluster -PrimaryClusterId "local" -DetailedObject | Select-Object @{N = "Name"; E = { $_.name } }, @{N = "Hostname"; E = { $_.hostname } }, @{N = "Username"; E = { $_.username } }, @{Name = "Connection Status"; Expression = { $_.connectionStatus.status } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] No Nutanix clusters detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] No Nutanix clusters detected, setting to null" $NutanixClusters = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving SCVMM Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving SCVMM Information" if ($null -ne $SCVMMServers -and 0 -ne $SCVMMServers[0].total) { $SCVMMServers = Get-RubrikScvmm -PrimaryClusterId "local" -DetailedObject | Select-Object @{N = "Name"; E = { $_.name } }, @{N = "Hostname"; E = { $_.hostname } }, @{N = "Run As"; E = { $_.runAsAccount } }, @{N = "Connection Status"; E = { $_.status } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] No SCVMM hosts detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] No SCVMM hosts detected, setting to null" $SCVMMServers = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Windows Hosts Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Windows Hosts Information" if ($null -ne $WindowsHosts -and 0 -ne $WindowsHosts[0].total) { $WindowsHosts = Get-RubrikHost -PrimaryClusterId "local" -Type "Windows" | Select-Object @{N = "Name"; E = { $_.name } }, @{N = "Hostname"; E = { $_.hostname } }, @{N = "Operating System"; E = { $_.operatingSystem } }, @{N = "Connection Status"; E = { $_.status } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] No Windows hosts detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] No Windows hosts detected, setting to null" $WindowsHosts = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Linux Hosts Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Linux Hosts Information" if ($null -ne $LinuxHosts -and 0 -ne $LinuxHosts[0].total) { $LinuxHosts = Get-RubrikHost -PrimaryClusterId "local" -Type "Linux" | Select-Object @{N = "Name"; E = { $_.name } }, @{N = "Hostname"; E = { $_.hostname } }, @{N = "Operating System"; E = { $_.operatingSystem } }, @{N = "Connection Status"; E = { $_.status } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] No Linux hosts detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] No Linux hosts detected, setting to null" $LinuxHosts = $null } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving vCenter Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving vCenter Information" $VMwarevCenter = Get-RubrikvCenter -PrimaryClusterId "local" | Select-Object @{N = "Name"; E = { $_.name } }, @{N = "Hostname"; E = { $_.hostname } }, @{N = "Username"; E = { $_.username } }, @{Name = "VM Linking"; Expression = { $_.conflictResolutionAuthz } }, @{Name = "Certificate"; E = { $_.caCerts } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving vCloud Directory Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving vCloud Director Information" $VMwareVCD = Get-RubrikVCD | Where-Object { $_.PrimaryClusterId -eq (Get-RubrikSetting).id } | Select-Object @{N = "Name"; E = { $_.name } }, @{N = "Hostname"; E = { $_.hostname } }, @{N = "Username"; E = { $_.username } }, @{Name = "Connection Status"; Expression = { $_.connectionStatus.status } }, @{Name = "Connection Message"; Expression = { $_.connectionStatus.message } }, @{N = "Certificate"; E = { $_.caCerts } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Nutanix Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Nutanix Information" if ($null -ne $NutanixClusters -and 0 -ne $NutanixClusters[0].total) { $NutanixClusters = Get-RubrikNutanixCluster -PrimaryClusterId "local" -DetailedObject | Select-Object @{N = "Name"; E = { $_.name } }, @{N = "Hostname"; E = { $_.hostname } }, @@ -448,10 +470,10 @@ function Invoke-AsBuiltReport.Rubrik.CDM { @{Name = "Connection Status"; Expression = { $_.connectionStatus.status } }, @{N = "Certificate"; E = { $_.caCerts } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] No Nutanix clusters detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] No Nutanix clusters detected, setting to null" $NutanixClusters = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving SCVMM Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving SCVMM Information" if ($null -ne $SCVMMServers -and 0 -ne $SCVMMServers[0].total) { $SCVMMServers = Get-RubrikScvmm -PrimaryClusterId "local" -DetailedObject | Select-Object @{N = "Name"; E = { $_.name } }, @{N = "Hostname"; E = { $_.hostname } }, @@ -459,10 +481,10 @@ function Invoke-AsBuiltReport.Rubrik.CDM { @{N = "Connection Status"; E = { $_.status } }, @{N = "Deploy Agent"; E = { $_.shouldDeployAgent } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] No SCVMM hosts detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] No SCVMM hosts detected, setting to null" $SCVMMServers = $null } - Write-Verbose -message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Windows Hosts Information" + Write-PScriboMessage -message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Windows Hosts Information" if ($null -ne $WindowsHosts -and 0 -ne $WindowsHosts[0].total) { $WindowsHosts = Get-RubrikHost -PrimaryClusterId "local" -Type "Windows" -DetailedObject | Select-Object @{N = "Name"; E = { $_.name } }, @{N = "Hostname"; E = { $_.hostname } }, @@ -477,10 +499,10 @@ function Invoke-AsBuiltReport.Rubrik.CDM { @{N = "VFD Enabled"; E = { $_.hostVfdEnabled } }, @{N = "Is Relic"; E = { $_.isRelic } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] No Windows hosts detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] No Windows hosts detected, setting to null" $WindowsHosts = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Linux Hosts Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Linux Hosts Information" if ($null -ne $LinuxHosts -and 0 -ne $LinuxHosts[0].total) { $LinuxHosts = Get-RubrikHost -PrimaryClusterId "local" -Type "Linux" -DetailedObject | Select-Object @{N = "Name"; E = { $_.name } }, @{N = "Hostname"; E = { $_.hostname } }, @@ -495,14 +517,14 @@ function Invoke-AsBuiltReport.Rubrik.CDM { @{N = "VFD Enabled"; E = { $_.hostVfdEnabled } }, @{N = "Is Relic"; E = { $_.isRelic } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] No Linux hosts detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] No Linux hosts detected, setting to null" $LinuxHosts = $null } } if (0 -ne ($VMwarevCenter | Measure-Object).count ) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Outputing vCenter Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Outputing vCenter Information" Section -Style Heading4 'VMware vCenter Servers' { Paragraph "The following table outlines the VMware vCenter Servers which have been added to the Rubrik cluster" if ($InfoLevel.Cluster -lt 3) { $VMwarevCenter | Table -Name 'VMware vCenter Server' } @@ -510,7 +532,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } if (0 -ne ($VMwareVCD | Measure-Object).count ) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output vCloud Director Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output vCloud Director Information" Section -Style Heading4 'VMware vCloud Director Clusters' { Paragraph "The following table outlines the VMware vCloud Director clusters which have been added to the Rubrik cluster" if ($InfoLevel.Cluster -lt 3) { $VMwareVCD | Table -Name 'VMware vCloud Director Clusters' } @@ -518,7 +540,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } if (0 -ne ($SCVMMServers | Measure-Object).count ) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Hyper-V Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Hyper-V Information" Section -Style Heading4 'Hyper-V SCVMM Servers' { Paragraph "The following table outlines the SCVMM Servers which have been added to the Rubrik cluster" if ($InfoLevel.Cluster -lt 3) { $SCVMMServers | Table -Name 'Hyper-V SCVMM Servers' } @@ -526,7 +548,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } if (0 -ne ($NutanixClusters | Measure-Object).count ) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Nutanix Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Nutanix Information" Section -Style Heading4 'Nutanix Clusters' { Paragraph "The following table outlines the Nutanix clusters which have been added to the Rubrik cluster" if ($InfoLevel.Cluster -lt 3) { $NutanixClusters | Table -Name 'Nutanix Clusters' } @@ -534,7 +556,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } if (0 -ne ($WindowsHosts | Measure-Object).count ) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Windows Host Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Windows Host Information" Section -Style Heading4 'Windows Hosts' { Paragraph "The following table outlines the Windows Hosts which have been added to the Rubrik cluster" if ($InfoLevel.Cluster -lt 3) { $WindowsHosts | Table -Name 'Windows Hosts' } @@ -542,7 +564,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } if (0 -ne ($LinuxHosts | Measure-Object).count ) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Linux Host Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Linux Host Information" Section -Style Heading4 'Linux Hosts' { Paragraph "The following table outlines the Linux Hosts which have been added to the Rubrik cluster" if ($InfoLevel.Cluster -lt 3) { $LinuxHosts | Table -Name 'Linux Hosts' } @@ -552,74 +574,78 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } # End Heading 3 Backup Sources Section -Style Heading3 'Replication Configuration' { Paragraph "The following contains information around the replication configuration on the cluster" - Write-Verbose -message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Replication Sources" + Write-PScriboMessage -message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Replication Sources" $ReplicationSources = Get-RubrikReplicationSource | Select-Object @{N = "Cluster Name"; E = { $_.sourceClusterName } }, @{N = "Cluster Address"; E = { $_.sourceClusterAddress } }, @{N = "Cluster UUID"; E = { $_.sourceClusterUuid } }, @{N = "Replication Network Setup"; E = { $_.replicationSetup } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Replication Targets" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Replication Targets" $ReplicationTargets = Get-RubrikReplicationTarget | Select-Object @{N = "Cluster Name"; E = { $_.targetClusterName } }, @{N = "Cluster Address"; E = { $_.targetClusterAddress } }, @{N = "Cluster UUID"; E = { $_.targetClusterUuid } }, @{N = "Replication Network Setup"; E = { $_.replicationSetup } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Replication Sources" - Section -Style Heading4 'Replication Sources' { - Paragraph "The following table outlines locations which have been configured as a replication source to this cluster" - $ReplicationSources | Table -Name 'Replication Sources' + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Replication Sources" + if (($ReplicationSources | Measure-Object).count -gt 0) { + Section -Style Heading4 'Replication Sources' { + Paragraph "The following table outlines locations which have been configured as a replication source to this cluster" + $ReplicationSources | Table -Name 'Replication Sources' + } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Replication Targets" - Section -Style Heading4 'Replication Targets' { - Paragraph "The following table outlines locations which have been configured as a replication targets for this cluster" - $ReplicationTargets | Table -Name 'Replication Sources' + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Replication Targets" + if (($ReplicationTargets | Measure-Object).count -gt 0) { + Section -Style Heading4 'Replication Targets' { + Paragraph "The following table outlines locations which have been configured as a replication targets for this cluster" + $ReplicationTargets | Table -Name 'Replication Targets' + } } } # End Heading 3 Replication Configuration Section -Style Heading3 'Archive Targets' { Paragraph "The following contains information around configured archive targets on the cluster" # Gather Information # Global Configs for all InfoLevels - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Archive Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Retrieving Archive Information" $ArchiveTargets = Get-RubrikArchive | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Bucket"; E = { $_.bucket } }, @{N = "State"; E = { $_.currentState } }, @{N = "LocationType"; E = { $_.locationType } } if ($InfoLevel.Cluster -lt 3) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output S3 Targets" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output S3 Targets" Section -Style Heading4 'S3 Targets' { - if ( ($ArchiveTargets | Where-Object { $_.locationType -eq 'S3' } | Measure-Object ).count -gt 0) { - $ArchiveTargets | Where-Object { $_.locationType -eq 'S3' } | Table -Name 'S3 Archives' + if ( ($ArchiveTargets | Where-Object { $_.locationType -eq 'S3' -or $_.locationType -eq 'S3Compatible' } | Measure-Object ).count -gt 0) { + $ArchiveTargets | Where-Object { $_.locationType -eq 'S3' -or $_.locationType -eq 'S3Compatible' } | Table -Name 'S3 Archives' } else { Paragraph "There are currently no S3 targets configured on the cluster." } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Glacier Targets" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Glacier Targets" Section -Style Heading4 'Glacier Targets' { if (($ArchiveTargets | Where-Object { $_.locationType -eq 'Glacier' } | Measure-Object ).count -gt 0) { $ArchiveTargets | Where-Object { $_.locationType -eq 'Glacier' } | Table -Name 'Glacier Archives' } else { Paragraph "There are currently no Glacier targets configured on the cluster." } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Azure Targets" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Azure Targets" Section -Style Heading4 'Azure Targets' { if (($ArchiveTargets | Where-Object { $_.locationType -eq 'Azure' } | Measure-Object ).count -gt 0) { $ArchiveTargets | Where-Object { $_.locationType -eq 'Azure' } | Table -Name 'Azure Archives' } else { Paragraph "There are currently no Azure targets configured on the cluster." } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Google Targets" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Google Targets" Section -Style Heading4 'Google Targets' { if (($ArchiveTargets | Where-Object { $_.locationType -eq 'Google' } | Measure-Object ).count -gt 0) { $ArchiveTargets | Where-Object { $_.locationType -eq 'Google' } | Table -Name 'Google Archives' } else { Paragraph "There are currently no Google Cloud targets configured on the cluster." } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output NFS Targets" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output NFS Targets" Section -Style Heading4 'NFS Targets' { if (($ArchiveTargets | Where-Object { $_.locationType -eq 'Nfs' } | Measure-Object ).count -gt 0) { $ArchiveTargets | Where-Object { $_.locationType -eq 'NFS' } | Table -Name 'NFS Archives' } else { Paragraph "There are currently no NFS targets configured on the cluster." } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Tape Targets" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Tape Targets" Section -Style Heading4 'Tape Targets' { if (($ArchiveTargets | Where-Object { $_.locationType -eq 'Qstar' } | Measure-Object ).count -gt 0) { $ArchiveTargets | Where-Object { $_.locationType -eq 'QStar' } | Table -Name 'Tape Archives' } else { Paragraph "There are currently no tape targets configured on the cluster." } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output S3 Targets" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output S3 Targets" Section -Style Heading4 'S3 Archive Targets' { if ( ($ArchiveTargets | Where-Object { $_.locationType -eq 'S3' } | Measure-Object ).count -gt 0) { $S3Targets = Get-RubrikArchive -ArchiveType S3 -DetailedObject | Select-Object @{Name = "Name"; Expression = { $_.definition.name } }, @@ -636,7 +662,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { $S3Targets | Table -Name 'S3 Archives' -List -ColumnWidths 30, 70 } else { Paragraph "There are currently no S3 targets configured on the cluster." } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Glacier Targets" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Glacier Targets" Section -Style Heading4 'Glacier Targets' { if (($ArchiveTargets | Where-Object { $_.locationType -eq 'Glacier' } | Measure-Object ).count -gt 0) { $GlacierTargets = Get-RubrikARchive -ArchiveType Glacier -DetailedObject | Select-Object @{Name = "Name"; Expression = { $_.definition.name } }, @@ -650,7 +676,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { @{Name = "NFS Options"; Expression = { $_.definition.otherNfsOptions } } } else { Paragraph "There are currently no Glacier targets configured on the cluster." } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Azure Targets" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Azure Targets" Section -Style Heading4 'Azure Targets' { if (($ArchiveTargets | Where-Object { $_.locationType -eq 'Azure' } | Measure-Object ).count -gt 0) { $AzureTargets = Get-RubrikArchive -ArchiveType Azure -DetailedObject | Select-Object @{Name = "Name"; Expression = { $_.definition.name } }, @@ -670,12 +696,12 @@ function Invoke-AsBuiltReport.Rubrik.CDM { $AzureTargets | Table -Name 'Azure Archive Targets' -List -ColumnWidths 30, 70 } else { Paragraph "There are currently no Azure targets configured on the cluster." } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Google Cloud Targets" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Google Cloud Targets" Section -Style Heading4 'Google Targets' { if (($ArchiveTargets | Where-Object { $_.locationType -eq 'Google' } | Measure-Object ).count -gt 0) { } else { Paragraph "There are currently no Google Cloud targets configured on the cluster." } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output NFS Targets" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output NFS Targets" Section -Style Heading4 'NFS Targets' { if (($ArchiveTargets | Where-Object { $_.locationType -eq 'NFS' } | Measure-Object ).count -gt 0) { $NFSTargets = Get-RubrikARchive -ArchiveType Nfs -DetailedObject | Select-Object @{Name = "Name"; Expression = { $_.definition.name } }, @@ -692,7 +718,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { $NFSTargets | Table -Name 'NFS Archive Targets' -List -ColumnWidths 30, 70 } else { Paragraph "There are currently no NFS targets configured on the cluster." } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Tape Targets" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Output Tape Targets" Section -Style Heading4 'Tape Targets' { if (($ArchiveTargets | Where-Object { $_.locationType -eq 'Qstar' } | Measure-Object ).count -gt 0) { } else { Paragraph "There are currently no tape targets configured on the cluster." } @@ -700,27 +726,27 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } # End Heading 3 Archive Targets } #End Heading 2 - Write-Verbose -Message "[Rubrik] [$($brik)] [Cluster Settings] Cluster Settings Section Complete" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Cluster Settings] Cluster Settings Section Complete" }# end of Infolevel 1 if ($InfoLevel.SLADomains -ge 1) { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Beginning SLA Domain Section with Info Level $($InfoLevel.SLADomains)" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Beginning SLA Domain Section with Info Level $($InfoLevel.SLADomains)" Section -Style Heading2 "SLA Domains" { Paragraph ("The following section provides information on the configured SLA Domains") BlankLine if ($InfoLevel.SLADomains -lt 3) { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving SLA Domain Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving SLA Domain Information" $SLADomains = Get-RubrikSLA -PrimaryClusterId 'local' | Select-Object @{N = "Name"; E = { $_.name } }, @{N = "Base Frequency"; E = { if ($_.frequencies.hourly) { '{0} Hours' -f $_.frequencies.hourly.frequency } elseif ($_.frequencies.daily) { '{0} Days' -f $_.frequencies.daily.frequency } } }, @{N = "Object Count"; E = { $_.numProtectedObjects } }, @{N = "Archival Location"; E = { (Get-RubrikArchive -id $_.archivalSpecs.locationId).Name } }, @{N = "Replication Location"; E = { (Get-RubrikReplicationTarget -id $_.replicationSpecs.locationId).targetClusterName } } - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Output SLA Domain Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Output SLA Domain Information" $SLADomains | Table -Name 'SLA Domain Summary' } elseif ($InfoLevel.SLADomains -le 5) { $SLADomains = Get-RubrikSLA -PrimaryClusterId 'local' foreach ($SLADomain in $SLADomains) { Section -Style Heading3 $SLADomain.name { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving detailed SLA Domain Information for $($sladomain.name)" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving detailed SLA Domain Information for $($sladomain.name)" Paragraph ("The following outlines the configuration options for $($sladomain.name)") Section -Style Heading4 "General Settings" { @@ -743,11 +769,11 @@ function Invoke-AsBuiltReport.Rubrik.CDM { 'Archival Location' = $ArchiveLocationName 'Replication Target' = $ReplicationLocationName } - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Output SLA Domain General Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Output SLA Domain General Settings" [PSCustomObject]$SLAGeneral | Table -Name "General Settings" -ColumnWidths 30, 70 -List } Section -Style Heading4 "SLA Frequency Settings" { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving SLA Domain Frequency Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving SLA Domain Frequency Information" if ($null -ne $SLADomain.advancedUiConfig -and '' -ne $SLADomain.advancedUiConfig) { $SLAFrequency = @() @@ -874,7 +900,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { $SLAFrequency += [pscustomobject]$yearly } } - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Output SLA Domain Frequency Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Output SLA Domain Frequency Settings" $SLAFrequency | Table -Name "SLA Frequencies" -Columns 'Take backups every', 'Retain backups for' } Section -Style Heading4 "SLA Backup Window" { @@ -930,12 +956,12 @@ function Invoke-AsBuiltReport.Rubrik.CDM { 'Backup Window' = "$backupWindowString" 'Take First Full' = "$firstFullString" } - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Output SLA Domain Backup Windows" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Output SLA Domain Backup Windows" [pscustomobject]$BackupWindows | Table -Name "SLA Backup Windows" -Columns "Backup Window", "Take First Full" -List } Section -Style Heading4 "SLA Archival Settings" { if ($null -ne $SLADomain.archivalSpecs.locationId) { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving SLA Domain Archive Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving SLA Domain Archive Information" $ArchiveInformation = Get-RubrikArchive -id $SLADomain.archivalSpecs.locationId -DetailedObject $Archive = [ordered] @{ @@ -943,7 +969,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { 'Archive Location Type' = $ArchiveInformation.locationType 'Archive data after' = "$($SLADomain.archivalSpecs.archivalThreshold/60/60/24) Day(s)" } - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Output SLA Domain Archive Information" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Output SLA Domain Archive Information" [pscustomobject]$Archive | Table -Name "Archival Information" -List -ColumnWidths 30, 70 } else { Paragraph ("SLA Domain is not configured for archival") @@ -951,7 +977,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } Section -Style Heading4 "SLA Replication Settings" { if ($null -ne $SLADomain.replicationSpecs.locationId) { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving SLA Domain Replication Settings" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving SLA Domain Replication Settings" $ReplicationInformation = Get-RubrikReplicationTarget -id $SLADomain.replicationSpecs.locationId $Replication = [ordered] @{ @@ -959,7 +985,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { 'Target Replication Cluster Address' = $ReplicationInformation.targetClusterAddress 'Keep Replica on target cluster for' = "$($SLADomain.replicationSpecs.retentionLimit/60/60/24) Day(s)" } - Write-Verbose "[Rubrik] [$($brik)] [SLA Domains] Output SLA Domain Replication Settings" + Write-PScriboMessage "[Rubrik] [$($brik)] [SLA Domains] Output SLA Domain Replication Settings" [pscustomobject]$Replication | Table -Name "Replication Information" -List -ColumnWidths 30, 70 } else { Paragraph ("SLA Domain is not configured for replication") @@ -968,7 +994,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { Section -Style Heading4 "SLA Protected Object Count" { if ($SLADomain.numProtectedObjects -gt 0) { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Output SLA Domain Protected Object Summary" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Output SLA Domain Protected Object Summary" $SLADomain | Table -Name "Protected Object Summary" -Columns numVms, numHypervVms, numNutanixVms, numVcdVapps, numEc2Instances, numDbs, numOracleDbs, numFilesets, numWindowsVolumeGroups, numManagedVolumes, numShares, numStorageArrayVolumeGroups -Headers 'VMware VMs', 'HyperV VMs', 'Nutanix VMs', 'VCD vApps', 'EC2 Instances', 'MSSQL DBs', 'Oracle DBs', 'Filesets', 'Windows Volume Groups', 'Managed Volumes', 'NAS Shares', 'Storage Array Volumes' -List -ColumnWidths 30, 70 } else { Paragraph ("There are no objects assigned to this SLA Domain") @@ -982,74 +1008,74 @@ function Invoke-AsBuiltReport.Rubrik.CDM { if ($SLADomain.numProtectedObjects -gt 0) { if ($SLADomain.numVms -gt 0) { Section -Style Heading5 "VMware VMs" { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving VMware VMs protected by SLA" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving VMware VMs protected by SLA" $Objects = Get-RubrikVM -SLAID $SLADomain.Id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } | Sort-Object -Property Name - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Output Protected VMware VMS" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Output Protected VMware VMS" $Objects | Table -Name "Protected VMware VMs" -ColumnWidths 50, 50 } } if ($SLADomain.numHyperVvms -gt 0) { Section -Style Heading5 "HyperV VMs" { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving protected Hyper-V VMs" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving protected Hyper-V VMs" $Objects = Get-RubrikHyperVVM -SLAID $SLADomain.Id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } | Sort-Object -Property Name - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Ouput HyperV VMs" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Ouput HyperV VMs" $Objects | Table -Name "Protected HyperV VMs" -ColumnWidths 50, 50 } } if ($SLADomain.numNutanixvms -gt 0) { Section -Style Heading5 "Nutanix VMs" { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving protected Nutanix VMs" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving protected Nutanix VMs" $Objects = Get-RubrikNutanixVM -SLAID $SLADomain.Id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } | Sort-Object -Property Name - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Output Nutanix VMs" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Output Nutanix VMs" $Objects | Table -Name "Protected Nutanix VMs" -ColumnWidths 50, 50 } } if ($SLADomain.numVcdVapps -gt 0) { Section -Style Heading5 "VCD vApps" { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving Protected vCloud Director vApps" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving Protected vCloud Director vApps" $Objects = Get-RubrikvApp -SLAID $SLADomain.Id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } | Sort-Object -Property Name - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Output VCD vApps" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Output VCD vApps" $Objects | Table -Name "Protected VCD vApps" -ColumnWidths 50, 50 } } #-=MWP=- Reserve for EC2 Instances - need to create cmdlet -=MWP=- if ($SLADomain.numDbs -gt 0) { Section -Style Heading5 "MSSQL Databases" { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving protected MSSQL DBs" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving protected MSSQL DBs" $Objects = Get-RubrikDatabase -SLAID $SLADomain.Id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Assignment Type"; E = { $_.slaAssignment } }, @{N = "Parent Host"; E = { $_.rootProperties.rootName } } | Sort-Object -Property Name - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Ouput MSSQL Databases" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Ouput MSSQL Databases" $Objects | Table -Name "Protected MSSQL Databases" -ColumnWidths 33, 33, 34 } } if ($SLADomain.numOracleDbs -gt 0) { Section -Style Heading5 "Oracle Databases" { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving Protected Oracle DBs" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving Protected Oracle DBs" $Objects = Get-RubrikOracleDB -SLAID $SLADomain.Id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Assignment Type"; E = { $_.slaAssignment } }, @{N = "ParentHost"; E = { $_.instances.hostName } } | Sort-Object -Property Name - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Output Oracle DBs" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Output Oracle DBs" $Objects | Table -Name "Protected Oracle Databases" -ColumnWidths 33, 33, 34 } } if ($SLADomain.numFilesets -gt 0) { Section -Style Heading5 "Filesets" { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving Protected filesets" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving Protected filesets" $Objects = Get-RubrikFileset -SLAID $SLADomain.Id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Assignment Type"; E = { "Direct" } }, @{N = "Attached to host"; E = { $_.hostname } } | Sort-Object -Property Name - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Output Protected Filesets" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Output Protected Filesets" $Objects | Table -Name "Protected Filesets" -ColumnWidths 33, 33, 34 } } if ($SLADomain.numWindowsVolumeGroups -gt 0) { Section -Style Heading5 "Windows Volume Groups" { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving Protected Windows Volume Groups" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving Protected Windows Volume Groups" $Objects = Get-RubrikVolumeGroup -SLAID $SLADomain.Id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Assignment Type"; E = { $_.slaAssignment } }, @{N = "Attached to host"; E = { $_.hostname } } | Sort-Object -Property Name - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Output Protected Volume Groups" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Output Protected Volume Groups" $Objects | Table -Name "Protected Volume Groups" -ColumnWidths 33, 33, 34 } } if ($SLADomain.numManagedVolumes -gt 0) { Section -Style Heading5 "Managed Volumes" { - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving Protected Managed Volumes" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] Retrieving Protected Managed Volumes" $Objects = Get-RubrikManagedVolume -SLAID $SLADomain.Id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } | Sort-Object -Property Name - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains]Output Managed Volumes [Rubrik] [$($brik)] [SLA Domains] " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains]Output Managed Volumes [Rubrik] [$($brik)] [SLA Domains] " $Objects | Table -Name "Protected Managed Volumes" -ColumnWidths 50, 50 } } @@ -1064,42 +1090,48 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } # End of ForEach SLA Domain } # End of Style Heading2 SLA Domains - Write-Verbose -Message "[Rubrik] [$($brik)] [SLA Domains] SLA Domain Section Complete" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [SLA Domains] SLA Domain Section Complete" } if ($InfoLevel.ProtectedObjects -ge 1) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Beginning Protected Objects Section with Info Level $($InfoLevel.ProtectedObjects)" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Beginning Protected Objects Section with Info Level $($InfoLevel.ProtectedObjects)" Section -Style Heading2 "Protected Objects" { Paragraph("The following shows details around all protected objects configured within the Rubrik cluster") if ($InfoLevel.ProtectedObjects -in (1, 2)) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected VMware VMs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected VMware VMs " $VMwareVMs = Get-RubrikVM -Relic:$false -PrimaryClusterID 'local' | Where-Object { $_.effectiveSlaDomainName -ne 'Unprotected' } | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Hyper V VMs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Hyper V VMs " $HyperVVMs = Get-RubrikHypervVM -Relic:$false -PrimaryClusterID local | Where-Object { $_.effectiveSlaDomainName -ne 'Unprotected' } | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Nutanix VMs" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Nutanix VMs" $NutanixVMs = Get-RubrikNutanixVM -Relic:$false -PrimaryClusterID local | Where-Object { $_.effectiveSlaDomainName -ne 'Unprotected' } | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected MSSQL DBs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected MSSQL DBs " $MSSQLDatabases = Get-RubrikDatabase -Relic:$false -PrimaryClusterID local | Where-Object { $_.effectiveSlaDomainName -ne 'Unprotected' } | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Recovery Model"; E = { $_.recoveryModel } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Oracle DBs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Oracle DBs " $OracleDatabases = Get-RubrikOracleDB -Relic:$false -PrimaryClusterID local | Where-Object { $_.effectiveSlaDomainName -ne 'Unprotected' } | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "SID"; E = { $_.sid } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Filesets " - $Filesets = Get-RubrikFileset -Relic:$false -PrimaryClusterID local -DetailedObject | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -eq $_.shareId } | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, - @{N = "Operating System"; E = { $_.operatingSystemType } }, @{N = "Fileset Name"; E = { $_.name } }, - @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected NAS Shares " - $NasShares = Get-RubrikFileset -Relic:$false -PrimaryClusterID local -DetailedObject | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -ne $_.shareId } | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, - @{N = "Fileset Name"; E = { $_.name } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Volume Groups " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Filesets " + $Filesets = Get-RubrikFileset -Relic:$false -PrimaryClusterID local | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -eq $_.shareId } + if ($null -ne $Filesets -and 0 -ne $Filesets[0].total ) { + $Filesets = Get-RubrikFileset -Relic:$false -PrimaryClusterID local -DetailedObject | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -eq $_.shareId } | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, + @{N = "Operating System"; E = { $_.operatingSystemType } }, @{N = "Fileset Name"; E = { $_.name } }, + @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } } + } + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected NAS Shares " + $NasShares = Get-RubrikFileset -Relic:$false -PrimaryClusterID local | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -ne $_.shareId } + if ($null -ne $NasShares -and 0 -ne $NasShares[0].total) { + $NasShares = Get-RubrikFileset -Relic:$false -PrimaryClusterID local -DetailedObject | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -ne $_.shareId } | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, + @{N = "Fileset Name"; E = { $_.name } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } } + } + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Volume Groups " $VolumeGroups = Get-RubrikVolumeGroup -Relic:$false -PrimaryClusterID local | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' } | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, @{N = "Volume Group name"; E = { $_.name } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Managed Volumes " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Managed Volumes " $ManagedVolumes = Get-RubrikManagedVolume -Relic:$false -PrimaryClusterID local | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' } | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Volume Size"; E = { $_.volumeSize } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } @@ -1110,81 +1142,96 @@ function Invoke-AsBuiltReport.Rubrik.CDM { #from the SDK. - This is temporary until code is properly handled within the #Rubrik PowerShell SDK #Applies to HyperV,Nutanix, MSSQL, Oracle, VolumeGroups below - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected VMware VMs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected VMware VMs " $VMwareVMs = Get-RubrikVM -Relic:$false -PrimaryClusterID 'local' | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "IP Address"; E = { $_.ipAddress } }, @{N = "vCenterName"; E = { ($_.infraPath | Where-Object { $_.managedId -like 'vCenter::*' } ).name } }, @{N = "RBSInstalled"; E = { $_.agentStatus.agentStatus } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } | Where-Object { $_.effectiveSlaDomainName -ne 'Unprotected' } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected HyperV VMs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected HyperV VMs " $HyperVVMs = Get-RubrikHypervVM -Relic:$false -PrimaryClusterID local if ($null -ne $HyperVVMs -and 0 -ne $HypervVMs[0].total) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] HyperV VMs detected, retrieving additional details " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] HyperV VMs detected, retrieving additional details " $HyperVVMs = $HyperVVMs | Where-Object { $_.effectiveSlaDomainName -ne 'Unprotected' } | ForEach-Object { Get-RubrikHyperVVM -id $_.id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "SCVMM Server"; E = { ($_.infraPath | Where-Object { $_.Id -like 'HypervScvmm::*' } ).name } }, @{N = "RBS Registered"; E = { $_.isAgentRegistered } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] No HyperV VMs detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] No HyperV VMs detected, setting to null" $HyperVVMs = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Nutanix VMs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Nutanix VMs " $NutanixVMs = Get-RubrikNutanixVM -Relic:$false -PrimaryClusterID local if ($null -ne $NutanixVMs -and 0 -ne $NutanixVMs[0].total) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Nutanix VMs detected, retrieving additional details " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Nutanix VMs detected, retrieving additional details " $NutanixVMs = $NutanixVMs | Where-Object { $_.effectiveSlaDomainName -ne 'Unprotected' } | ForEach-Object { Get-RubrikNutanixVM -id $_.id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Cluster Name"; E = { $_.nutanixClusterName } }, @{N = "RBS Registered"; E = { $_.isAgentRegistered } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] No Nutanix VMs detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] No Nutanix VMs detected, setting to null" $NutanixVMs = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected MSSQL DBs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected MSSQL DBs " $MSSQLDatabases = Get-RubrikDatabase -Relic:$false -PrimaryClusterID local if ($null -ne $MSSQLDatabases -and 0 -ne $MSSQLDatabases[0].total) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] MSSQL DBs detected, retrieving additional details " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] MSSQL DBs detected, retrieving additional details " $MSSQLDatabases = $MSSQLDatabases | Where-Object { $_.effectiveSlaDomainName -ne 'Unprotected' } | ForEach-Object { Get-RubrikDatabase -id $_.id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Instance"; E = { if ($null -eq $_.instanceName) { "N/A" } else { $_.instanceName } } }, @{N = "LocationName"; E = { $_.rootProperties.rootName } }, @{N = "Recovery Model"; E = { if ($null -eq $_.recoveryModel) { "N/A" } else { $_.recoveryModel } } }, @{N = "Log Backup Frequency (seconds)"; E = { $_.logBackupFrequencyInSeconds } }, @{N = "Log Retention (hours)"; E = { $_.logBackupRetentionHours } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] No MSSQL Databases detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] No MSSQL Databases detected, setting to null" $MSSQLDatabases = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Oracle DBs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Oracle DBs " $OracleDatabases = Get-RubrikOracleDB -Relic:$false -PrimaryClusterID local if ($null -ne $OracleDatabases -and 0 -ne $OracleDatabases[0].total) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Oracle DBs detected, retrieving additional details " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Oracle DBs detected, retrieving additional details " $OracleDatabases = $OracleDatabases | Where-Object { $_.effectiveSlaDomainName -ne 'Unprotected' } | ForEach-Object { Get-RubrikOracleDb -id $_.id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "SID"; E = { $_.sid } }, @{N = "# Tablespaces"; E = { $_.numTablespaces } }, @{N = "Oracle Host"; E = { $_.standaloneHostName } }, @{N = "Log Enabled"; E = { $_.isArchiveLogModeEnabled } }, @{N = "Log Backup Frequency (minutes)"; E = { $_.logBackupFrequencyInMinutes } }, @{N = "Log Retention (Hours)"; E = { $_.logRetentionHours } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } } } else { - Write-Verbose -Message "No Oracle DBs detected, setting to null" + Write-PScriboMessage -Message "No Oracle DBs detected, setting to null" $OracleDatabases = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Filesets " - $Filesets = Get-RubrikFileset -Relic:$false -PrimaryClusterID local -DetailedObject | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -eq $_.shareId } | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, - @{N = "Operating System"; E = { $_.operatingSystemType } }, @{N = "Fileset Name"; E = { $_.name } }, - @{N = "Includes"; E = { $_.includes | Out-String } }, @{N = "Excludes"; E = { $_.excludes | Out-String } }, - @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected NAS Shares " - $NasShares = Get-RubrikFileset -Relic:$false -PrimaryClusterID local -DetailedObject | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -ne $_.shareId } | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, - @{N = "Operating System"; E = { $_.operatingSystemType } } , @{N = "Fileset Name"; E = { $_.name } }, - @{N = "Includes"; E = { $_.includes | Out-String } }, @{N = "Excludes"; E = { $_.excludes | Out-String } }, - @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Volume Groups " + + $Filesets = Get-RubrikFileset -Relic:$false -PrimaryClusterID local | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -eq $_.shareId } + if ($null -ne $Filesets -and 0 -ne $Filesets[0].total) { + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Filesets " + $Filesets = Get-RubrikFileset -Relic:$false -PrimaryClusterID local -DetailedObject | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -eq $_.shareId } | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, + @{N = "Operating System"; E = { $_.operatingSystemType } }, @{N = "Fileset Name"; E = { $_.name } }, + @{N = "Includes"; E = { $_.includes | Out-String } }, @{N = "Excludes"; E = { $_.excludes | Out-String } }, + @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } } + } + else { + Write-PScriboMessage -Message "No Filesets detected, setting to null" + $Filesets = $null + } + $NasShares = Get-RubrikFileset -Relic:$false -PrimaryClusterID local | Where-object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -ne $_.shareId } + if ($null -ne $NasShares -and 0 -ne $NasShares[0].total) { + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected NAS Shares " + $NasShares = Get-RubrikFileset -Relic:$false -PrimaryClusterID local -DetailedObject | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -ne $_.shareId } | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, + @{N = "Operating System"; E = { $_.operatingSystemType } } , @{N = "Fileset Name"; E = { $_.name } }, + @{N = "Includes"; E = { $_.includes | Out-String } }, @{N = "Excludes"; E = { $_.excludes | Out-String } }, + @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } } + } + else { + Write-PScriboMessage "No NAS Shares detected, setting to null" + $NasShares = $null + } + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Volume Groups " $VolumeGroups = Get-RubrikVolumeGroup -Relic:$false -PrimaryClusterID local if ($null -ne $VolumeGroups -and 0 -ne $VolumeGroups[0].total) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Volume Groups detected, retrieving additional details " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Volume Groups detected, retrieving additional details " $VolumeGroups = $VolumeGroups | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' } | ForEach-Object { Get-RubrikVolumeGroup -id $_.id | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, @{N = "Volume Group name"; E = { $_.name } }, @{N = "Includes"; E = { $_.includes | Out-String } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Assignment Type"; E = { $_.slaAssignment } } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] No Volume Groups detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] No Volume Groups detected, setting to null" $VolumeGroups = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Managed Volumes " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Managed Volumes " $ManagedVolumes = Get-RubrikManagedVolume -Relic:$false -PrimaryClusterID local | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' } | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Volume Size"; E = { $_.volumeSize } }, @{N = "Used"; E = { $_.usedSize } }, @{N = "Is Writable"; E = { $_.isWritable } }, @{N = "State"; E = { $_.state } }, @@ -1197,10 +1244,10 @@ function Invoke-AsBuiltReport.Rubrik.CDM { #from the SDK. - This is temporary until code is properly handled within the #Rubrik PowerShell SDK #Applies to VMware VMs, HyperV, Nutanix, MSSQL, Oracle, VolumeGroups below - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected VMware VMs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected VMware VMs " $VMwareVMs = Get-RubrikVM -Relic:$false -PrimaryClusterID 'local' - if (0 -ne $VMwareVMs[0].total) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] VMware VMs detected, gathering additional details " + if ($null -ne $VMwareVMs) { + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] VMware VMs detected, gathering additional details " $VMwareVMs = $VMwareVMs | Where-Object { $_.effectiveSlaDomainName -ne 'Unprotected' } | ForEach-Object { Get-RubrikVM -id $_.id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "IP Address"; E = { $_.ipAddress } }, @{N = "Guest OS"; E = { $_.guestOsType } }, @{N = "ESXiHost"; E = { ($_.infraPath | Where-Object { $_.managedId -like 'VMwareHost::*' } ).name } }, @@ -1212,13 +1259,13 @@ function Invoke-AsBuiltReport.Rubrik.CDM { @{N = "Oldest Backup"; E = { ($_.snapshots | Sort-Object -Property Date | Select-Object -First 1).date } }, @{N = "Latest Backup"; E = { ($_.snapshots | Sort-Object -Property Date | Select-Object -Last 1).date } } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] No VMware VMs detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] No VMware VMs detected, setting to null" $VMwareVMs = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Hyper-V VMs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Hyper-V VMs " $HyperVVMs = Get-RubrikHypervVM -Relic:$false -PrimaryClusterID local if ($null -ne $HypervVMs -and 0 -ne $HypervVMs[0].total) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] HyperV VMs detectected, gathering addtional details " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] HyperV VMs detectected, gathering addtional details " $HyperVVMs = $HyperVVMs | Where-Object { $_.effectiveSlaDomainName -ne 'Unprotected' } | ForEach-Object { Get-RubrikHyperVVM -id $_.id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "HyperV Server"; E = { ($_.infraPath | Where-Object { $_.Id -like 'HypervServer::*' } ).name } }, @{N = "HyperV Cluster"; E = { ($_.infraPath | Where-Object { $_.Id -like 'HypervCluster::*' } ).name } }, @@ -1228,13 +1275,13 @@ function Invoke-AsBuiltReport.Rubrik.CDM { @{N = "Latest Backup"; E = { ( Get-RubrikSnapshot -id $_.id -latest ).date } }, @{N = "Oldest Backup"; E = { (Get-RubrikSnapshot -id $_.id | Sort-Object -Property date | Select-Object -First 1).date } } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] No HyperV VMs detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] No HyperV VMs detected, setting to null" $HyperVVMs = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Nutanix VMs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Nutanix VMs " $NutanixVMs = Get-RubrikNutanixVM -Relic:$false -PrimaryClusterID local if ($null -ne $NutanixVMs -and 0 -ne $NutanixVMs[0].total) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Nutanix VMs detected, gathering addtional details " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Nutanix VMs detected, gathering addtional details " $NutanixVMs = $NutanixVMs | Where-Object { $_.effectiveSlaDomainName -ne 'Unprotected' } | ForEach-Object { Get-RubrikNutanixVM -id $_.id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Cluster Name"; E = { $_.nutanixClusterName } }, @{N = "RBS Registered"; E = { $_.isAgentRegistered } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Assignment Type"; E = { $_.slaAssignment } }, @@ -1242,13 +1289,13 @@ function Invoke-AsBuiltReport.Rubrik.CDM { @{N = "Latest Backup"; E = { ( Get-RubrikSnapshot -id $_.id -latest ).date } }, @{N = "Oldest Backup"; E = { (Get-RubrikSnapshot -id $_.id | Sort-Object -Property date | Select-Object -First 1).date } } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] No Nutanix VMs detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] No Nutanix VMs detected, setting to null" $NutanixVMs = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected MSSQL Databases " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected MSSQL Databases " $MSSQLDatabases = Get-RubrikDatabase -Relic:$false -PrimaryClusterID local if ($null -ne $MSSQLDatabases -and 0 -ne $MSSQLDatabases[0].total) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] MSSQL DBs detected, gathering addtional information " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] MSSQL DBs detected, gathering addtional information " $MSSQLDatabases = $MSSQLDatabases | Where-Object { $_.effectiveSlaDomainName -ne 'Unprotected' } | ForEach-Object { Get-RubrikDatabase -id $_.id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Instance"; E = { if ($null -eq $_.instanceName) { "N/A" } else { $_.instanceName } } }, @{N = "Location Name"; E = { $_.rootProperties.rootName } }, @{N = "Recovery Model"; E = { if ($null -eq $_.recoveryModel) { "N/A" } else { $_.recoveryModel } } }, @{N = "Log Backup Frequency (seconds)"; E = { $_.logBackupFrequencyInSeconds } }, @@ -1258,13 +1305,13 @@ function Invoke-AsBuiltReport.Rubrik.CDM { @{N = "Snapshot Count"; E = { $_.snapshotCount } }, @{N = "Oldest Backup"; E = { $_.oldestRecoveryPoint } }, @{N = "Latest Backup"; E = { $_.latestRecoveryPoint } } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] No MSSQL DBs detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] No MSSQL DBs detected, setting to null" $MSSQLDatabases = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Oracle DBs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Oracle DBs " $OracleDatabases = Get-RubrikOracleDB -Relic:$false -PrimaryClusterID local if ($null -ne $OracleDatabases -and 0 -ne $OracleDatabases[0].total) { - Write-Verbose "[Rubrik] [$($brik)] [Protected Objects] Oracle DBs detected, gathering additional information " + Write-PScriboMessage "[Rubrik] [$($brik)] [Protected Objects] Oracle DBs detected, gathering additional information " $OracleDatabases = $OracleDatabases | Where-Object { $_.effectiveSlaDomainName -ne 'Unprotected' } | ForEach-Object { Get-RubrikOracleDb -id $_.id | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "SID"; E = { $_.sid } }, @{N = "# Tablespaces"; E = { $_.numTablespaces } }, @{N = "Oracle Host"; E = { $_.standaloneHostName } }, @{N = "Log Enabled"; E = { $_.isArchiveLogModeEnabled } }, @@ -1273,27 +1320,42 @@ function Invoke-AsBuiltReport.Rubrik.CDM { @{N = "Snapshot Count"; E = { $_.snapshotCount } }, @{N = "Oldest Backup"; E = { $_.oldestRecoveryPoint } }, @{N = "Latest Backup"; E = { $_.latestRecoveryPoint } } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] No Oracle DBs detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] No Oracle DBs detected, setting to null" $OracleDatabases = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Filesets " - $Filesets = Get-RubrikFileset -Relic:$false -PrimaryClusterID local -DetailedObject | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -eq $_.shareId } | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, - @{N = "Operating System"; E = { $_.operatingSystemType } }, @{N = "Fileset Name"; E = { $_.name } }, - @{N = "Includes"; E = { $_.includes | Out-String } }, @{N = "Excludes"; E = { $_.excludes | Out-String } }, - @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Snapshot Count"; E = { $_.snapshotCount } }, - @{N = "Oldest Backup"; E = { (Get-RubrikSnapshot -id $_.id | Sort-Object -Property Date | Select-Object -First 1).date } }, - @{N = "Latest Backup"; E = { (Get-RubrikSnapshot -id $_.id | Sort-Object -Property Date | Select-Object -Last 1).date } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected NAS Share s" - $NasShares = Get-RubrikFileset -Relic:$false -PrimaryClusterID local -DetailedObject | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -ne $_.shareId } | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, - @{N = "Operating System"; E = { $_.operatingSystemType } }, @{N = "Fileset Name"; E = { $_.name } }, - @{N = "Includes"; E = { $_.includes | Out-String } }, @{N = "Excludes"; E = { $_.excludes | Out-String } }, - @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Snapshot Count"; E = { $_.snapshotCount } }, - @{N = "Oldest Backup"; E = { (Get-RubrikSnapshot -id $_.id | Sort-Object -Property Date | Select-Object -First 1).date } }, - @{N = "Latest Backup"; E = { (Get-RubrikSnapshot -id $_.id | Sort-Object -Property Date | Select-Object -Last 1).date } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Volume Groups " + $Filesets = Get-RubrikFileset -Relic:$false -PrimaryClusterID local | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -eq $_.shareId } + if ($null -ne $filesets -and 0 -ne $Filesets[0].total) { + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Filesets " + $Filesets = Get-RubrikFileset -Relic:$false -PrimaryClusterID local -DetailedObject | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -eq $_.shareId } | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, + @{N = "Operating System"; E = { $_.operatingSystemType } }, @{N = "Fileset Name"; E = { $_.name } }, + @{N = "Includes"; E = { $_.includes | Out-String } }, @{N = "Excludes"; E = { $_.excludes | Out-String } }, + @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Snapshot Count"; E = { $_.snapshotCount } }, + @{N = "Oldest Backup"; E = { (Get-RubrikSnapshot -id $_.id | Sort-Object -Property Date | Select-Object -First 1).date } }, + @{N = "Latest Backup"; E = { (Get-RubrikSnapshot -id $_.id | Sort-Object -Property Date | Select-Object -Last 1).date } } + } + else { + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] No Filesets detected, setting to null" + $Filesets = $null + } + $NasShares = Get-RubrikFileset -Relic:$false -PrimaryClusterID local | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -ne $_.shareId } + if ($null -ne $NasShares -and 0 -ne $NasShares[0].total ) { + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected NAS Share s" + $NasShares = Get-RubrikFileset -Relic:$false -PrimaryClusterID local -DetailedObject | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' -and $null -ne $_.shareId } | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, + @{N = "Operating System"; E = { $_.operatingSystemType } }, @{N = "Fileset Name"; E = { $_.name } }, + @{N = "Includes"; E = { $_.includes | Out-String } }, @{N = "Excludes"; E = { $_.excludes | Out-String } }, + @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Snapshot Count"; E = { $_.snapshotCount } }, + @{N = "Oldest Backup"; E = { (Get-RubrikSnapshot -id $_.id | Sort-Object -Property Date | Select-Object -First 1).date } }, + @{N = "Latest Backup"; E = { (Get-RubrikSnapshot -id $_.id | Sort-Object -Property Date | Select-Object -Last 1).date } } + } + else { + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] No NAS Shares detected, setting to null" + $NasShares = $null + } + + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Volume Groups " $VolumeGroups = Get-RubrikVolumeGroup -Relic:$false -PrimaryClusterID local if ($null -ne $VolumeGroups -and 0 -ne $VolumeGroups[0].total) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Volume Groups detected, gathering additional details " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Volume Groups detected, gathering additional details " $VolumeGroups = $VolumeGroups | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' } | ForEach-Object { Get-RubrikVolumeGroup -id $_.id | Select-Object -Property @{N = "Hostname"; E = { $_.hostname } }, @{N = "Volume Group name"; E = { $_.name } }, @{N = "Includes"; E = { $_.includes | Out-String } }, @{N = "SLA Domain"; E = { $_.effectiveSlaDomainName } }, @{N = "Assignment Type"; E = { $_.slaAssignment } }, @@ -1301,10 +1363,10 @@ function Invoke-AsBuiltReport.Rubrik.CDM { @{N = "LatestBackup"; E = { ( Get-RubrikSnapshot -id $_.id -latest ).date } }, @{N = "OldestBackup"; E = { (Get-RubrikSnapshot -id $_.id | Sort-Object -Property date | Select-Object -First 1).date } } } } else { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] No Volume Groups detected, setting to null" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] No Volume Groups detected, setting to null" $VolumeGroups = $null } - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Managed Volumes " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Retrieving Protected Managed Volumes " $ManagedVolumes = Get-RubrikManagedVolume -Relic:$false -PrimaryClusterID local | Where-Object { $_.effectiveSlaDomainId -ne 'Unprotected' } | Select-Object -Property @{N = "Name"; E = { $_.name } }, @{N = "Volume Size"; E = { $_.volumeSize } }, @{N = "Used"; E = { $_.usedSize } }, @{N = "Is Writable"; E = { $_.isWritable } }, @{N = "State"; E = { $_.state } }, @@ -1315,7 +1377,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } if (0 -ne ($VMwareVMs | Measure-Object).count) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Output VMware VMs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Output VMware VMs " Section -Style Heading3 "VMware Virtual Machines" { if ($InfoLevel.ProtectedObjects -ge 5) { $VMwareVMs | Sort-Object -Property Name | Table -Name "Protected VMware VMs" -List -ColumnWidths 30, 70 @@ -1325,7 +1387,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } if (0 -ne ($HyperVVMs | Measure-Object).count) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Output HyperV VMs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Output HyperV VMs " Section -Style Heading3 "Hyper-V Virtual Machines" { if ($InfoLevel.ProtectedObjects -ge 5) { $HyperVVMs | Sort-Object -Property Name | Table -Name "Protected HyperV VMs" -List -ColumnWidths 30, 70 @@ -1335,7 +1397,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } if (0 -ne ($NutanixVMs | Measure-Object).count) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Output Nutanix VMs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Output Nutanix VMs " Section -Style Heading3 "Nutanix Virtual Machines" { if ($InfoLevel.ProtectedObjects -ge 5) { $NutanixVMs | Sort-Object -Property Name | Table -Name "Protected Nutanix VMs" -List -ColumnWidths 30, 70 @@ -1345,7 +1407,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } if (0 -ne ($MSSQLDatabases | Measure-Object).count) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Output MSSQL DBs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Output MSSQL DBs " Section -Style Heading3 "MSSQL Databases" { if ($InfoLevel.ProtectedObjects -ge 5) { $MSSQLDatabases | Sort-Object -Property Name | Table -Name "Protected MSSQL Databases" -List -ColumnWidths 30, 70 @@ -1355,7 +1417,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } if (0 -ne ($OracleDatabases | Measure-Object).count) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Output Oracle DBs " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Output Oracle DBs " Section -Style Heading3 "Oracle Databases" { if ($InfoLevel.ProtectedObjects -ge 5) { $OracleDatabases | Sort-Object -Property Name | Table -Name "Protected Oracle Databases" -List -ColumnWidths 30, 70 @@ -1365,7 +1427,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } if (0 -ne ($Filesets | Measure-Object).count) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Output Filesets " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Output Filesets " Section -Style Heading3 "Filesets" { if ($InfoLevel.ProtectedObjects -ge 5) { $Filesets | Sort-Object -Property operatingSystemType, Name | Table -Name "Protected Filesets" -List -ColumnWidths 30, 70 @@ -1375,7 +1437,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } if (0 -ne ($NasShares | Measure-Object).count) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Output NAS Shares " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Output NAS Shares " Section -Style Heading3 "NAS Shares" { if ($InfoLevel.ProtectedObjects -ge 5) { $NasShares | Sort-Object -Property operatingSystemType, Name | Table -Name "Protected NAS Shares" -List -ColumnWidths 30, 70 @@ -1385,7 +1447,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } if (0 -ne ($VolumeGroups | Measure-Object).count) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Output Volume Groups " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Output Volume Groups " Section -Style Heading3 "Volume Groups" { if ($InfoLevel.ProtectedObjects -ge 5) { $VolumeGroups | Sort-Object -Property hostName | Table -Name "Protected Volume Groups" -List -ColumnWidths 30, 70 @@ -1395,7 +1457,7 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } if (0 -ne ($ManagedVolumes | Measure-Object).count) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Output Managed Volumes " + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Output Managed Volumes " Section -Style Heading3 "Managed Volumes" { if ($InfoLevel.ProtectedObjects -ge 5) { $ManagedVolumes | Sort-Object -Property name | Table -Name "Protected Managed Volumes" -List -ColumnWidths 30, 70 @@ -1405,22 +1467,24 @@ function Invoke-AsBuiltReport.Rubrik.CDM { } } } # end of Style Heading2 Protected Objects - Write-Verbose -Message "[Rubrik] [$($brik)] [Protected Objects] Protected Objects Section Complete" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Protected Objects] Protected Objects Section Complete" } if ($InfoLevel.SnapshotRetention -ge 1) { - Write-Verbose -Message "[Rubrik] [$($brik)] [Snapshot Retention] Beginning Snapshot Retention Section with Info Level $($InfoLevel.SnapshotRetention)" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Snapshot Retention] Beginning Snapshot Retention Section with Info Level $($InfoLevel.SnapshotRetention)" Section -Style Heading2 "Snapshot Retention" { Paragraph ("The following displays all relic, expired, and unmanaged objects within the Rubrik cluster") - Write-Verbose -Message "[Rubrik] [$($brik)] [Snapshot Retention] Retrieving Unmanaged Objects" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Snapshot Retention] Retrieving Unmanaged Objects" $UnmanagedObjects = Get-RubrikUnmanagedObject - Write-Verbose -Message "[Rubrik] [$($brik)] [Snapshot Retention] Output Unmanaged Objects" - if ($InfoLevel.SnapshotRetention -in (1, 2)) { - $UnmanagedObjects | Sort-Object -Property Name, objecttype | Table -Name "Unmanaged Objects" -Columns Name, objectType, retentionSlaDomainName -Headers 'Name', 'ObjectType', 'Retention SLA Domain' - } elseif ($InfoLevel.SnapshotRetention -in (3, 4, 5)) { - $UnmanagedObjects | Sort-Object -Property Name, objecttype | Table -Name "Unmanaged Objects" -Columns Name, objectType, retentionSlaDomainName, autoSnapshotCount, manualSnapshotCount, localStorage, archiveStorage, unmanagedStatus -Headers 'Name', 'ObjectType', 'Retention SLA Domain', 'Automatic Snapshots', 'Manual Snapshots', 'Local Storage', 'Archival Storage', 'Unmanaged Status' -List -ColumnWidths 30, 70 + if (($UnmanagedObjects | Measure-Object).Count -gt 0) { + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Snapshot Retention] Output Unmanaged Objects" + if ($InfoLevel.SnapshotRetention -in (1, 2)) { + $UnmanagedObjects | Sort-Object -Property Name, objecttype | Table -Name "Unmanaged Objects" -Columns Name, objectType, retentionSlaDomainName -Headers 'Name', 'ObjectType', 'Retention SLA Domain' + } elseif ($InfoLevel.SnapshotRetention -in (3, 4, 5)) { + $UnmanagedObjects | Sort-Object -Property Name, objecttype | Table -Name "Unmanaged Objects" -Columns Name, objectType, retentionSlaDomainName, autoSnapshotCount, manualSnapshotCount, localStorage, archiveStorage, unmanagedStatus -Headers 'Name', 'ObjectType', 'Retention SLA Domain', 'Automatic Snapshots', 'Manual Snapshots', 'Local Storage', 'Archival Storage', 'Unmanaged Status' -List -ColumnWidths 30, 70 + } } } - Write-Verbose -Message "[Rubrik] [$($brik)] [Snapshot Retention] Snapshot Retention Section Complete" + Write-PScriboMessage -Message "[Rubrik] [$($brik)] [Snapshot Retention] Snapshot Retention Section Complete" } # end of Style Heading2 Snapshot Retention } } # End of if $RubrikCluster @@ -1429,4 +1493,4 @@ function Invoke-AsBuiltReport.Rubrik.CDM { #endregion Script Body -} # End Invoke-AsBuiltReport.Rubrik.CDM function \ No newline at end of file +} # End Invoke-AsBuiltReport.Rubrik.CDM function