├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── change_request.yml │ └── config.yml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── Codeql.yml │ ├── PSScriptAnalyzer.yml │ ├── PSScriptAnalyzerSettings.psd1 │ └── Release.yml ├── .vscode └── settings.json ├── AsBuiltReport.VMware.Horizon.Style.ps1 ├── AsBuiltReport.VMware.Horizon.json ├── AsBuiltReport.VMware.Horizon.psd1 ├── AsBuiltReport.VMware.Horizon.psm1 ├── CHANGELOG.md ├── LICENSE ├── README.md ├── Samples └── Sample VMware Horizon As Built Report.html └── Src ├── Private ├── Get-AbrHRZADDomain.ps1 ├── Get-AbrHRZAccessGroup.ps1 ├── Get-AbrHRZAdminGroup.ps1 ├── Get-AbrHRZApplicationPool.ps1 ├── Get-AbrHRZCertMgmt.ps1 ├── Get-AbrHRZCloudPod.ps1 ├── Get-AbrHRZConnectionServer.ps1 ├── Get-AbrHRZDatastore.ps1 ├── Get-AbrHRZDesktopPool.ps1 ├── Get-AbrHRZDomain.ps1 ├── Get-AbrHRZESXi.ps1 ├── Get-AbrHRZEventConf.ps1 ├── Get-AbrHRZFarm.ps1 ├── Get-AbrHRZFederationAccessGroup.ps1 ├── Get-AbrHRZGatewayCert.ps1 ├── Get-AbrHRZGlobalEntitlement.ps1 ├── Get-AbrHRZGlobalPolicy.ps1 ├── Get-AbrHRZGlobalSetting.ps1 ├── Get-AbrHRZHCConnection.ps1 ├── Get-AbrHRZHCDataStore.ps1 ├── Get-AbrHRZHCDomain.ps1 ├── Get-AbrHRZHCESXiHost.ps1 ├── Get-AbrHRZHCEventDataBase.ps1 ├── Get-AbrHRZHCGatewayServer.ps1 ├── Get-AbrHRZHCLicenseService.ps1 ├── Get-AbrHRZHCRDSFarm.ps1 ├── Get-AbrHRZHCRemotePod.ps1 ├── Get-AbrHRZHCSAML2.ps1 ├── Get-AbrHRZHCTrueSSO.ps1 ├── Get-AbrHRZHCvCenter.ps1 ├── Get-AbrHRZHomeSite.ps1 ├── Get-AbrHRZInfrastructure.ps1 ├── Get-AbrHRZInstantClone.ps1 ├── Get-AbrHRZLicense.ps1 ├── Get-AbrHRZLocalEntitlement.ps1 ├── Get-AbrHRZMachine.ps1 ├── Get-AbrHRZRegisteredMachine.ps1 ├── Get-AbrHRZRolePermission.ps1 ├── Get-AbrHRZRolePrivilege.ps1 ├── Get-AbrHRZSite.ps1 ├── Get-AbrHRZTSSO.ps1 ├── Get-AbrHRZUAG.ps1 ├── Get-AbrHRZUnauthenticatedACL.ps1 ├── Get-AbrHRZVcenter.ps1 ├── Get-RequiredModule.ps1 └── SharedUtilsFunctions.ps1 └── Public └── Invoke-ASBuiltReport.VMware.Horizon.ps1 /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: File a bug report 3 | labels: ["bug"] 4 | assignees: 5 | - childebrandt42 6 | body: 7 | - type: textarea 8 | id: bug-description 9 | attributes: 10 | label: Bug description 11 | description: >- 12 | Please provide a clear and concise description of the bug. 13 | validations: 14 | required: true 15 | - type: input 16 | id: command-line-input 17 | attributes: 18 | label: Command-line input 19 | description: >- 20 | Please provide the command line input you are using to run AsBuiltReport. Please ensure that you obscure any sensitive information. 21 | placeholder: New-AsBuiltReport -Report VMware.Horizon -Target xxxxxxx -Format Word,HTML -OutputFolderPath .\Documents\ -AsBuiltConfigFilePath .\AsBuiltReport\AsBuiltReport.json -ReportConfigFilePath .\AsBuiltReport\AsBuiltReport.VMware.Horizon.json -EnableHealthCheck -Verbose 22 | validations: 23 | required: true 24 | - type: textarea 25 | id: steps-to-reproduce 26 | attributes: 27 | label: Steps to reproduce 28 | description: >- 29 | Please provide a detailed list of steps to reproduce the bug. 30 | placeholder: |- 31 | 1. .... 32 | 2. .... 33 | 3. .... 34 | validations: 35 | required: true 36 | - type: textarea 37 | id: expected-behaviour 38 | attributes: 39 | label: Expected behaviour 40 | description: >- 41 | Please provide a clear and concise description of what you expected to happen. 42 | validations: 43 | required: true 44 | - type: textarea 45 | id: screenshots 46 | attributes: 47 | label: Screenshots 48 | description: >- 49 | Please attach any screenshots to help explain the problem. Please ensure that you obscure any sensitive information. 50 | placeholder: |- 51 | Drag and drop screenshots here. 52 | - type: textarea 53 | id: operating-system 54 | attributes: 55 | label: Operating System 56 | description: Please provide information about the operating system are you using. 57 | placeholder: macOS Big Sur, Windows 10, Ubuntu 20.04 LTS 58 | validations: 59 | required: true 60 | - type: textarea 61 | id: powershell-version 62 | attributes: 63 | label: PowerShell Version 64 | description: Please provide information about the PowerShell version you are using. Please provide the output from the following PowerShell command `$PSVersionTable`. 65 | placeholder: $PSVersionTable 66 | validations: 67 | required: true 68 | - type: textarea 69 | id: powershell-modules 70 | attributes: 71 | label: PowerShell Modules 72 | description: Please provide information about the PowerShell modules are you using. Please provide the output from the following PowerShell command `Get-Module -ListAvailable @("AsBuiltReport.Core";"AsBuiltReport.VMware.Horizon";"PScribo") | Select Name, Version` 73 | placeholder: Get-Module -ListAvailable @("AsBuiltReport.Core";"AsBuiltReport.VMware.Horizon";"PScribo") | Select Name, Version 74 | validations: 75 | required: true 76 | - type: textarea 77 | id: additional-context 78 | attributes: 79 | label: Additional Context 80 | description: This field is optional. You may provide additional context for the bug you wish to report. You may wish to include links to any related [issues](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues) or other relevant information. 81 | - type: checkboxes 82 | id: checklist 83 | attributes: 84 | label: Before submitting 85 | description: >- 86 | Please ensure your bug report fulfills all of the following requirements. 87 | If you are unsure of what a specific requirement means, please follow the links to learn about it and understand why it is necessary before submitting. 88 | options: 89 | - label: >- 90 | I have read and followed the [bug reporting guidelines](https://www.asbuiltreport.com/about/contributing/#reporting-issues-and-bugs). 91 | required: true 92 | - label: >- 93 | I have read [the documentation](https://www.asbuiltreport.com/user-guide/new-asbuiltconfig), 94 | and referred to the [known issues](https://www.asbuiltreport.com/user-guide/known-issues/) before submitting this bug report. 95 | required: true 96 | - label: >- 97 | I have checked for previously opened & closed [issues](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues) before submitting this bug report. 98 | required: true 99 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/change_request.yml: -------------------------------------------------------------------------------- 1 | name: Change Request 2 | description: Request a new change or an improvement 3 | labels: ["change request"] 4 | assignees: 5 | - childebrandt42 6 | body: 7 | - type: textarea 8 | id: description 9 | attributes: 10 | label: Description 11 | description: >- 12 | Please provide a detailed description of your idea so that the project maintainers and contributors can fully understand what change, feature, or improvement you are proposing. 13 | validations: 14 | required: true 15 | - type: textarea 16 | id: additional-context 17 | attributes: 18 | label: Additional Context 19 | description: This field is optional. You may provide additional context for the idea you wish to propose. You may wish to include links to any related [issues](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues) or other relevant information. 20 | - type: checkboxes 21 | id: checklist 22 | attributes: 23 | label: Before submitting 24 | description: >- 25 | Please ensure your change request fulfills all of the following requirements. 26 | If you are unsure of what a specific requirement means, please follow the links to learn about it and understand why it is necessary before submitting. 27 | options: 28 | - label: >- 29 | I have read [the documentation](https://www.asbuiltreport.com/user-guide/new-asbuiltconfig), 30 | and referred to the [known issues](https://www.asbuiltreport.com/user-guide/known-issues/) before submitting this change request. 31 | required: true 32 | - label: >- 33 | I have checked for previously opened & closed [issues](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues) before submitting this change request. 34 | required: true 35 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Description 4 | 5 | 6 | ## Related Issue 7 | 8 | 9 | 10 | 11 | 12 | ## Motivation and Context 13 | 14 | 15 | ## How Has This Been Tested? 16 | 17 | 18 | 19 | 20 | ## Screenshots (if appropriate): 21 | 22 | ## Types of changes 23 | 24 | - [ ] Bug fix (non-breaking change which fixes an issue) 25 | - [ ] New feature (non-breaking change which adds functionality) 26 | - [ ] Breaking change (fix or feature that would cause existing functionality to change) 27 | 28 | ## Checklist: 29 | 30 | 31 | - [ ] My code follows the code style of this project. 32 | - [ ] My change requires a change to the documentation. 33 | - [ ] I have updated the documentation accordingly. 34 | - [ ] I have read the [**CONTRIBUTING**](/CONTRIBUTING.md) document. 35 | -------------------------------------------------------------------------------- /.github/workflows/Codeql.yml: -------------------------------------------------------------------------------- 1 | # This workflow uses actions that are not certified by GitHub. 2 | # They are provided by a third-party and are governed by 3 | # separate terms of service, privacy policy, and support 4 | # documentation. 5 | # 6 | # https://github.com/microsoft/action-psscriptanalyzer 7 | # For more information on PSScriptAnalyzer in general, see 8 | # https://github.com/PowerShell/PSScriptAnalyzer 9 | 10 | name: CodeQL 11 | 12 | on: 13 | push: 14 | branches: [ "dev" ] 15 | pull_request: 16 | branches: [ "dev" ] 17 | 18 | permissions: 19 | contents: read 20 | 21 | jobs: 22 | build: 23 | permissions: 24 | contents: read # for actions/checkout to fetch code 25 | security-events: write # for github/codeql-action/upload-sarif to upload SARIF results 26 | actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status 27 | name: PSScriptAnalyzer 28 | runs-on: ubuntu-latest 29 | steps: 30 | - uses: actions/checkout@v4 31 | 32 | - name: Run PSScriptAnalyzer 33 | uses: microsoft/psscriptanalyzer-action@v1.1 34 | with: 35 | # Check https://github.com/microsoft/action-psscriptanalyzer for more info about the options. 36 | # The below set up runs PSScriptAnalyzer to your entire repository and runs some basic security rules. 37 | path: .\ 38 | recurse: true 39 | # Include your own basic security rules. Removing this option will run all the rules 40 | excludeRule: '"PSAvoidUsingPlainTextForPassword", "PSAvoidUsingUsernameAndPasswordParams", "PSAvoidUsingConvertToSecureStringWithPlainText"' 41 | output: results.sarif 42 | 43 | # Upload the SARIF file generated in the previous step 44 | - name: Upload SARIF results file 45 | uses: github/codeql-action/upload-sarif@v3 46 | with: 47 | sarif_file: results.sarif 48 | -------------------------------------------------------------------------------- /.github/workflows/PSScriptAnalyzer.yml: -------------------------------------------------------------------------------- 1 | name: PSScriptAnalyzer 2 | on: [push, pull_request] 3 | jobs: 4 | lint: 5 | name: Run PSScriptAnalyzer 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v4 9 | - name: lint 10 | uses: devblackops/github-action-psscriptanalyzer@master 11 | with: 12 | sendComment: true 13 | failOnErrors: true 14 | failOnWarnings: false 15 | failOnInfos: false 16 | repoToken: ${{ secrets.GITHUB_TOKEN }} 17 | settingsPath: .github/workflows/PSScriptAnalyzerSettings.psd1 -------------------------------------------------------------------------------- /.github/workflows/PSScriptAnalyzerSettings.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | ExcludeRules = @( 3 | 'PSUseToExportFieldsInManifest', 4 | 'PSReviewUnusedParameter', 5 | 'PSUseDeclaredVarsMoreThanAssignments', 6 | 'PSAvoidGlobalVars' 7 | ) 8 | } -------------------------------------------------------------------------------- /.github/workflows/Release.yml: -------------------------------------------------------------------------------- 1 | name: Publish PowerShell Module 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | publish-to-gallery: 9 | runs-on: windows-2019 10 | steps: 11 | - uses: actions/checkout@v4 12 | - name: Set PSRepository to Trusted for PowerShell Gallery 13 | shell: pwsh 14 | run: | 15 | Set-PSRepository -Name PSGallery -InstallationPolicy Trusted 16 | - name: Install AsBuiltReport.Core module 17 | shell: pwsh 18 | run: | 19 | Install-Module -Name AsBuiltReport.Core -Repository PSGallery -Force 20 | - name: Test Module Manifest 21 | shell: pwsh 22 | run: | 23 | Test-ModuleManifest .\AsBuiltReport.VMware.Horizon.psd1 24 | - name: Publish module to PowerShell Gallery 25 | shell: pwsh 26 | run: | 27 | Publish-Module -Path ./ -NuGetApiKey ${{ secrets.PSGALLERY_API_KEY }} -Verbose 28 | tweet: 29 | needs: publish-to-gallery 30 | runs-on: ubuntu-latest 31 | steps: 32 | - uses: Eomm/why-don-t-you-tweet@v2 33 | # We don't want to tweet if the repository is not a public one 34 | if: ${{ !github.event.repository.private }} 35 | with: 36 | # GitHub event payload 37 | # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release 38 | tweet-message: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #VMware #Horizon #AsBuiltReport #PowerShell #vExpert" 39 | env: 40 | TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }} 41 | TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} 42 | TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} 43 | TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} 44 | bsky-post: 45 | needs: publish-to-gallery 46 | runs-on: ubuntu-latest 47 | steps: 48 | - uses: zentered/bluesky-post-action@v0.1.0 49 | with: 50 | post: "[New Release] ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}! Check out what's new! ${{ github.event.release.html_url }} #Omnissa #VMware #Horizon #vExpert #AsBuiltReport #PowerShell" 51 | env: 52 | BSKY_IDENTIFIER: ${{ secrets.BSKY_IDENTIFIER }} 53 | BSKY_PASSWORD: ${{ secrets.BSKY_PASSWORD }} -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powershell.codeFormatting.preset": "Custom", 3 | "powershell.codeFormatting.useCorrectCasing": true, 4 | "powershell.codeFormatting.autoCorrectAliases": true, 5 | "powershell.codeFormatting.whitespaceBeforeOpenBrace": true, 6 | "powershell.codeFormatting.whitespaceBeforeOpenParen": true, 7 | "powershell.codeFormatting.whitespaceAroundOperator": true, 8 | "powershell.codeFormatting.whitespaceAfterSeparator": true, 9 | "powershell.codeFormatting.addWhitespaceAroundPipe": true, 10 | "powershell.codeFormatting.ignoreOneLineBlock": true, 11 | "powershell.codeFormatting.newLineAfterCloseBrace": false, 12 | "powershell.codeFormatting.newLineAfterOpenBrace": true, 13 | "powershell.codeFormatting.openBraceOnSameLine": true, 14 | "powershell.codeFormatting.alignPropertyValuePairs": false, 15 | "powershell.codeFolding.enable": true, 16 | "powershell.scriptAnalysis.enable": true, 17 | "powershell.scriptAnalysis.settingsPath": ".github/workflows/PSScriptAnalyzerSettings.psd1", 18 | "editor.tabSize": 4, 19 | "editor.insertSpaces": true, 20 | "editor.detectIndentation": false, 21 | "editor.rulers": [ 22 | 115 23 | ], 24 | "files.trimTrailingWhitespace": true, 25 | "cSpell.words": [ 26 | "Hildebrandt", 27 | "Iain", 28 | "jcolonfzenpr", 29 | "karlnewick", 30 | "Newick", 31 | "Scribo" 32 | ] 33 | } -------------------------------------------------------------------------------- /AsBuiltReport.VMware.Horizon.json: -------------------------------------------------------------------------------- 1 | { 2 | "Report": { 3 | "Name": "Omnissa Horizon As Built Report", 4 | "Version": "1.0", 5 | "Status": "Released", 6 | "ShowCoverPageImage": true, 7 | "ShowTableOfContents": true, 8 | "ShowHeaderFooter": true, 9 | "ShowTableCaptions": true 10 | }, 11 | "Options": {}, 12 | "InfoLevel": { 13 | "_comment_": "0 = Disabled, 1 = Summary, 2 = Informative, 3 = Detailed", 14 | "UsersAndGroups": { 15 | "Entitlements": 1, 16 | "HomeSiteAssignments": 1, 17 | "UnauthenticatedAccess": 1 18 | }, 19 | "Inventory": { 20 | "Desktop": 1, 21 | "Applications": 1, 22 | "Farms": 1, 23 | "Machines": 1, 24 | "GlobalEntitlements": 1 25 | }, 26 | "Settings": { 27 | "Servers": { 28 | "vCenterServers": { 29 | "vCenter": 1, 30 | "ESXiHosts": 1, 31 | "DataStores": 1, 32 | "ADDomains": 1 33 | }, 34 | "UAG": { 35 | "UAGServers": 1 36 | }, 37 | "ConnectionServers": { 38 | "ConnectionServers": 1, 39 | "TrueSSO": 1 40 | } 41 | }, 42 | "InstantClone": { 43 | "InstantCloneDomainAccounts": 1 44 | }, 45 | "ProductLicensing": { 46 | "ProductLicensingandUsage": 1 47 | }, 48 | "GlobalSettings": { 49 | "GlobalSettings": 1 50 | }, 51 | "RegisteredMachines": { 52 | "RDSHosts": 1 53 | }, 54 | "Administrators": { 55 | "AdministratorsandGroups": 1, 56 | "RolePrivileges": 1, 57 | "RolePermissions": 1, 58 | "AccessGroup": 1, 59 | "FederationAccessGroup": 1 60 | }, 61 | "CloudPodArch": { 62 | "CloudPodArch": 1 63 | }, 64 | "Sites": { 65 | "Sites": 1 66 | }, 67 | "EventConfiguration": { 68 | "EventDatabase": 1, 69 | "Syslog": 1, 70 | "EventstoFileSystem": 1 71 | }, 72 | "GlobalPolicies": { 73 | "GlobalPolicies": 1 74 | } 75 | } 76 | }, 77 | "HealthCheck": { 78 | "HealthCheck": { 79 | "Overview": true 80 | }, 81 | "Components": { 82 | "ConnectionServers": true, 83 | "GatewayServer": true, 84 | "EventDataBase": true, 85 | "TrueSSO": true 86 | }, 87 | "RDSFarms": { 88 | "RDSFarms": true 89 | }, 90 | "vSphere": { 91 | "DataStores": true, 92 | "vCenter": true, 93 | "ESXiHosts": true 94 | }, 95 | "OtherComponents": { 96 | "Domains": true, 97 | "SAML2": true, 98 | "LicenseService": true 99 | }, 100 | "RemotePod": { 101 | "RemotePod": true 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /AsBuiltReport.VMware.Horizon.psd1: -------------------------------------------------------------------------------- 1 | # 2 | # Module manifest for module 'AsBuiltReport.VMware.Horizon' 3 | # 4 | # Generated by: Chris.Hildebrandt 5 | # 6 | # Generated on: 7/6/2019 7 | # 8 | 9 | @{ 10 | 11 | # Script module or binary module file associated with this manifest. 12 | RootModule = 'AsBuiltReport.VMware.Horizon.psm1' 13 | 14 | # Version number of this module. 15 | ModuleVersion = '1.1.5.1' 16 | 17 | # Supported PSEditions 18 | # CompatiblePSEditions = @() 19 | 20 | # ID used to uniquely identify this module 21 | GUID = '2d7d49b3-b010-453c-8a35-22b19f9b7a17' 22 | 23 | # Author of this module 24 | Author = 'Chris Hildebrandt' 25 | 26 | # Company or vendor of this module 27 | #CompanyName = 'Unknown' 28 | 29 | # Copyright statement for this module 30 | Copyright = '(c) 2025 Chris Hildebrandt. All rights reserved.' 31 | 32 | # Description of the functionality provided by this module 33 | Description = 'A PowerShell module to generate as built reports on the configuration of VMware Horizon' 34 | 35 | # Minimum version of the Windows PowerShell engine required by this module 36 | PowerShellVersion = '5.1' 37 | 38 | # Name of the Windows PowerShell host required by this module 39 | # PowerShellHostName = '' 40 | 41 | # Minimum version of the Windows PowerShell host required by this module 42 | # PowerShellHostVersion = '' 43 | 44 | # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. 45 | # DotNetFrameworkVersion = '' 46 | 47 | # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. 48 | # CLRVersion = '' 49 | 50 | # Processor architecture (None, X86, Amd64) required by this module 51 | # ProcessorArchitecture = '' 52 | 53 | # Modules that must be imported into the global environment prior to importing this module 54 | RequiredModules = @( 55 | @{ 56 | ModuleName = 'AsBuiltReport.Core'; 57 | ModuleVersion = '1.4.2' 58 | } 59 | ) 60 | # Assemblies that must be loaded prior to importing this module 61 | # RequiredAssemblies = @() 62 | 63 | # Script files (.ps1) that are run in the caller's environment prior to importing this module. 64 | # ScriptsToProcess = @() 65 | 66 | # Type files (.ps1xml) to be loaded when importing this module 67 | # TypesToProcess = @() 68 | 69 | # Format files (.ps1xml) to be loaded when importing this module 70 | # FormatsToProcess = @() 71 | 72 | # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess 73 | # NestedModules = @() 74 | 75 | # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. 76 | FunctionsToExport = @('Invoke-AsBuiltReport.VMware.Horizon') 77 | 78 | # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. 79 | #CmdletsToExport = @() 80 | 81 | # Variables to export from this module 82 | #VariablesToExport = '*' 83 | 84 | # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. 85 | #AliasesToExport = @() 86 | 87 | # DSC resources to export from this module 88 | # DscResourcesToExport = @() 89 | 90 | # List of all modules packaged with this module 91 | # ModuleList = @() 92 | 93 | # List of all files packaged with this module 94 | # FileList = @() 95 | 96 | # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. 97 | PrivateData = @{ 98 | 99 | PSData = @{ 100 | # Tags applied to this module. These help with module discovery in online galleries. 101 | Tags = 'AsBuiltReport', 'Report', 'VMware', 'Horizon', 'Documentation', 'PScribo', 'PSEdition_Desktop', 'Windows', 'Omnissa' 102 | 103 | # A URL to the license for this module. 104 | LicenseUri = 'https://raw.githubusercontent.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/master/LICENSE' 105 | 106 | # A URL to the main website for this project. 107 | ProjectUri = 'https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon' 108 | 109 | # A URL to an icon representing this module. 110 | IconUri = 'https://raw.githubusercontent.com/AsBuiltReport/AsBuiltReport/master/AsBuiltReport.png' 111 | 112 | # ReleaseNotes of this module 113 | ReleaseNotes = 'https://raw.githubusercontent.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/master/CHANGELOG.md' 114 | 115 | # Prerelease string of this module 116 | # Prerelease = '' 117 | 118 | # Flag to indicate whether the module requires explicit user acceptance for install/update/save 119 | # RequireLicenseAcceptance = $false 120 | 121 | # External dependent modules of this module 122 | # ExternalModuleDependencies = @() 123 | 124 | } # End of PSData hashtable 125 | 126 | } # End of PrivateData hashtable 127 | 128 | # HelpInfo URI of this module 129 | # HelpInfoURI = '' 130 | 131 | # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. 132 | # DefaultCommandPrefix = '' 133 | 134 | } 135 | 136 | -------------------------------------------------------------------------------- /AsBuiltReport.VMware.Horizon.psm1: -------------------------------------------------------------------------------- 1 | # Get public and private function definition files and dot source them 2 | $Public = @(Get-ChildItem -Path $PSScriptRoot\Src\Public\*.ps1 -ErrorAction SilentlyContinue) 3 | $Private = @(Get-ChildItem -Path $PSScriptRoot\Src\Private\*.ps1 -ErrorAction SilentlyContinue) 4 | 5 | foreach ($Module in @($Public + $Private)) { 6 | try { 7 | . $Module.FullName 8 | } catch { 9 | Write-Error -Message "Failed to import function $($Module.FullName): $_" 10 | } 11 | } 12 | 13 | Export-ModuleMember -Function $Public.BaseName 14 | Export-ModuleMember -Function $Private.BaseName -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # :arrows_clockwise: VMware Horizon As Built Report Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | ## [1.1.5.1] - 2025-03-13 9 | 10 | ### Fixed 11 | - Fix `Get-RequiredModule` script function to properly check for installed VMware PowerCLI versions ([Fix #36](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/36)) 12 | 13 | ## [1.1.5] - 2025-01-21 14 | 15 | ### Added 16 | 17 | - Added TrueSSO Certificate details and Health Check Section 18 | 19 | ### Changed 20 | 21 | - Tested with Horizon 2406 22 | - Added TrueSSO Cetificate details section 23 | - Added Health Check module 24 | - Increased AsBuiltReport.Core minimum requirements to v1.4.2 25 | - Increased Eomm/why-don-t-you-tweet Github action to v2 26 | 27 | ### Fixed 28 | 29 | - Resolved the Following issues: 30 | - [#30](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/30) 31 | 32 | ## [1.1.4] - 2024-11-22 33 | 34 | ### Added 35 | 36 | - Tested Report with Horizon 8.13 37 | 38 | ### Changed 39 | 40 | - Changed Required Modules to AsBuiltReport.Core v1.4.0 41 | - Improved detection of empty fields in tables 42 | - Improved detection of true/false elements in tables 43 | - Updated GitHub release workflow to add post to Bluesky social platform 44 | - Updated sample report 45 | 46 | ## [1.1.3] - 2024-02-14 47 | 48 | ### Added 49 | 50 | - Added module version validation 51 | 52 | ### Changed 53 | 54 | - Updated VMware PowerCLI requirements to v13.2 55 | - Updated Sample Reports 56 | - Updated CodeQL upload-sarif action requirement to v3 57 | - Updated PSScriptAnalyzer checkout action requirement to v4 58 | - Updated PublishPowerShellModule checkout action requirement to v4 59 | 60 | ### Fixed 61 | 62 | - Resolved the Following issues: 63 | - [#15](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/15), [#16](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/16), [#17](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/17), [#18](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/18), [#19](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/19), [#20](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/20), [#21](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/21), [#22](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/22), [#23](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/23), [#24](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/24) 64 | 65 | ## [1.1.2] - 2024-02-02 66 | 67 | ### Fixed 68 | 69 | - Renamed Domains Connection Server Section. Resolve [#13](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/13) 70 | - Fixed Admin Users and Groups bug details reporting incorrectly. Resolve [#12](https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon/issues/12) 71 | 72 | ## [1.1.0] - 2023-12-19 73 | 74 | ### Added 75 | 76 | - Updated Report to work with Horizon 2309 77 | - Added Features for Certificates and Replication status 78 | - Improved functionaliy and layout. 79 | 80 | ## [0.2.0] - 2022-08-17 81 | 82 | ### Added 83 | 84 | - Migrate report to new module format 85 | - Implement better error handling 86 | - Improve report layout 87 | - A set of Horizon infrastructure health checks has been introduced. 88 | 89 | ## [0.1.0] - 2020-07-27 90 | 91 | ### Added 92 | 93 | - Initial Release @childebrandt42 94 | - Develop core horizon modules and sections 95 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 AsBuiltReport 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZADDomain.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZADDomain { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | begin { 25 | Write-PScriboMessage "ADDomains InfoLevel set at $($InfoLevel.Settings.Servers.vCenterServers.ADDomains)." 26 | Write-PScriboMessage "Collecting Active Directory Domain information." 27 | } 28 | process { 29 | try { 30 | if ($Domains) { 31 | if ($InfoLevel.Settings.Servers.vCenterServers.ADDomains -ge 1) { 32 | Section -Style Heading4 "Active Directory Domains" { 33 | Paragraph "The following section summarizes the configuration of Active Directory Domains for $($HVEnvironment.split('.')[0]) server." 34 | BlankLine 35 | $OutObj = @() 36 | foreach ($Domain in $Domains) { 37 | try { 38 | Write-PScriboMessage "Discovered Domain Information $($Domain.DNSName)." 39 | $inObj = [ordered] @{ 40 | 'Domain DNS Name' = $Domain.DNSName 41 | 'Status' = $Domain.ConnectionServerState[0].Status 42 | 'Trust Relationship' = $Domain.ConnectionServerState[0].TrustRelationship 43 | 'Connection Status' = $Domain.ConnectionServerState[0].Contactable 44 | } 45 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 46 | } catch { 47 | Write-PScriboMessage -IsWarning $_.Exception.Message 48 | } 49 | } 50 | if ($HealthCheck.DataStores.Status) { 51 | $OutObj | Where-Object { $_.'Status' -eq 'ERROR' } | Set-Style -Style Warning 52 | } 53 | $TableParams = @{ 54 | Name = "Active Directory Domains - $($HVEnvironment.split(".").toUpper()[0])" 55 | List = $false 56 | ColumnWidths = 25, 25, 25, 25 57 | } 58 | if ($Report.ShowTableCaptions) { 59 | $TableParams['Caption'] = "- $($TableParams.Name)" 60 | } 61 | $OutObj | Sort-Object -Property 'Name' | Table @TableParams 62 | } 63 | } 64 | } 65 | } catch { 66 | Write-PScriboMessage -IsWarning $_.Exception.Message 67 | } 68 | } 69 | end {} 70 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZAccessGroup.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZAccessGroup { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "AccessGroup InfoLevel set at $($InfoLevel.Settings.Administrators.AccessGroup)." 27 | Write-PScriboMessage "Collecting Access Group information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($AccessGroups) { 33 | if ($InfoLevel.Settings.Administrators.AccessGroup -ge 1) { 34 | Section -Style Heading3 "Access Groups" { 35 | Paragraph "The following section summarizes the configuration of Access Groups for $($HVEnvironment.toUpper()) server." 36 | BlankLine 37 | $OutObj = @() 38 | $AccessGroupJoined = @() 39 | $AccessGroupJoined += $AccessGroups 40 | $AccessGroupJoined += $AccessGroups.Children 41 | foreach ($AccessGroup in $AccessGroupJoined) { 42 | Write-PScriboMessage "Discovered $($AccessGroup.base.Name) Access Groups Information." 43 | $inObj = [ordered] @{ 44 | 'Name' = $AccessGroup.base.Name 45 | 'Description' = $AccessGroup.base.Description 46 | } 47 | 48 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 49 | } 50 | 51 | $TableParams = @{ 52 | Name = "Access Groups - $($HVEnvironment.toUpper())" 53 | List = $false 54 | ColumnWidths = 35, 65 55 | } 56 | 57 | if ($Report.ShowTableCaptions) { 58 | $TableParams['Caption'] = "- $($TableParams.Name)" 59 | } 60 | $OutObj | Sort-Object -Property 'Name' | Table @TableParams 61 | try { 62 | if ($InfoLevel.Settings.Administrators.AccessGroup -ge 2) { 63 | Section -Style Heading4 "Access Groups Details" { 64 | $AccessGroupJoined = @() 65 | $AccessGroupJoined += $AccessGroups 66 | $AccessGroupJoined += $AccessGroups.Children 67 | foreach ($AccessGroup in $AccessGroupJoined) { 68 | Write-PScriboMessage "Discovered $($AccessGroup.base.Name) Access Groups Detailed Information." 69 | $AdministratorIDNameResults = @() 70 | # Find Administrator ID Name 71 | foreach ($AccessGroupID in $AccessGroup.data.Permissions.id) { 72 | foreach ($Permission in $Permissions) { 73 | if ($AccessGroupID -eq $Permission.id.id) { 74 | foreach ($PermissionGroup in $Permission.base.UserOrGroup.id) { 75 | foreach ($Administrator in $Administrators) { 76 | if ($Administrator.Id.id -eq $PermissionGroup) { 77 | $AdministratorIDNameResults += $Administrator.base.name 78 | break 79 | } 80 | } 81 | $AdministratorIDName = $AdministratorIDNameResults 82 | } 83 | } 84 | } 85 | } 86 | if ($AdministratorIDName) { 87 | Section -ExcludeFromTOC -Style NOTOCHeading5 $AccessGroup.base.Name { 88 | $OutObj = @() 89 | foreach ($Principal in ($AdministratorIDName | Select-Object -Unique)) { 90 | $PrincipalPermissionsName = @() 91 | $PrincipalID = ($Administrators | Where-Object { $_.Base.Name -eq $Principal }).Id.Id 92 | $PrincipalPermissions = ($Permissions.Base | Where-Object { $_.UserOrGroup.Id -eq $PrincipalID }).Role.Id 93 | foreach ($PrincipalPermission in $PrincipalPermissions) { 94 | $PrincipalPermissionsName += $(($Roles | Where-Object { $_.Id.id -eq $PrincipalPermission }).Base.Name) 95 | } 96 | 97 | $inObj = [ordered] @{ 98 | 'Name' = $Principal 99 | 'Permissions' = [string](($PrincipalPermissionsName | Select-Object -Unique) -join ', ') 100 | } 101 | 102 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 103 | } 104 | 105 | $TableParams = @{ 106 | Name = "Access Groups - $($AccessGroup.base.Name)" 107 | List = $false 108 | ColumnWidths = 35, 65 109 | } 110 | 111 | if ($Report.ShowTableCaptions) { 112 | $TableParams['Caption'] = "- $($TableParams.Name)" 113 | } 114 | $OutObj | Sort-Object -Property 'Name' | Table @TableParams 115 | } 116 | } 117 | } 118 | } 119 | } 120 | } catch { 121 | Write-PScriboMessage -IsWarning $_.Exception.Message 122 | } 123 | } 124 | } 125 | } 126 | } catch { 127 | Write-PScriboMessage -IsWarning $_.Exception.Message 128 | } 129 | } 130 | end {} 131 | } 132 | -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZAdminGroup.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZAdminGroup { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Administrators InfoLevel set at $($InfoLevel.Settings.Administrators.AdministratorsandGroups)." 27 | Write-PScriboMessage "Collecting Registered Machines information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($Administrators) { 33 | if ($InfoLevel.Settings.Administrators.AdministratorsandGroups -ge 1) { 34 | Section -Style Heading3 "Administrators and Groups" { 35 | Paragraph "The following section details the configuration of Administrators and Groups for $($HVEnvironment.toUpper()) server." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($Administrator in $Administrators) { 39 | $RoleIDNameResults = '' 40 | foreach ($Permission in $Permissions) { 41 | if ($Administrator.PermissionData.Permissions.id -eq $Permission.id.id) { 42 | # Find Role ID Name 43 | $RoleIDName = '' 44 | $PermissionGroups = $Permission.base.Role.id 45 | foreach ($PermissionGroup in $PermissionGroups) { 46 | foreach ($Role in $Roles) { 47 | if ($Role.Id.id -eq $PermissionGroup) { 48 | $RoleIDName = $Role.base.name 49 | break 50 | } 51 | } 52 | if ($Administrator.PermissionData.Permissions.id.count -gt 1) { 53 | $RoleIDNameResults += "$RoleIDName, " 54 | $RoleIDName = $RoleIDNameResults.TrimEnd(', ') 55 | } 56 | } 57 | } 58 | } 59 | 60 | Write-PScriboMessage "Discovered Administrators and Groups Information." 61 | $inObj = [ordered] @{ 62 | 'Display Name' = $Administrator.base.DisplayName 63 | 'Type' = Switch ($Administrator.base.Group) { 64 | $False { 'User' } 65 | $True { 'Group' } 66 | } 67 | 'Permission Role' = [string](($RoleIDName.split(', ') | Select-Object -Unique) -join ', ') 68 | } 69 | 70 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 71 | } 72 | 73 | $TableParams = @{ 74 | Name = "Administrators and Groups - $($HVEnvironment.toUpper())" 75 | List = $false 76 | ColumnWidths = 42, 15, 43 77 | } 78 | 79 | if ($Report.ShowTableCaptions) { 80 | $TableParams['Caption'] = "- $($TableParams.Name)" 81 | } 82 | $OutObj | Sort-Object -Property 'Display Name' | Table @TableParams 83 | try { 84 | if ($InfoLevel.Settings.Administrators.AdministratorsandGroups -ge 2) { 85 | foreach ($Administrator in $Administrators) { 86 | Section -Style Heading4 "Administrators Users and Groups Details for $($Administrator.base.Name)" { 87 | Write-PScriboMessage "Discovered $($Administrator.base.Name) Information." 88 | $RoleIDNameResults = '' 89 | foreach ($Permission in $Permissions) { 90 | if ($Administrator.PermissionData.Permissions.id -eq $Permission.id.id) { 91 | # Find Role ID Name 92 | $RoleIDName = '' 93 | $PermissionGroups = $Permission.base.Role.id 94 | foreach ($PermissionGroup in $PermissionGroups) { 95 | foreach ($Role in $Roles) { 96 | if ($Role.Id.id -eq $PermissionGroup) { 97 | $RoleIDName = $Role.base.name 98 | break 99 | } 100 | } 101 | if ($Administrator.PermissionData.Permissions.id.count -gt 1) { 102 | $RoleIDNameResults += "$RoleIDName, " 103 | $RoleIDName = $RoleIDNameResults.TrimEnd(', ') 104 | } 105 | } 106 | } 107 | } 108 | Switch ($Administrator.base.Group) { 109 | 'True' { $Administratorbasegroup = 'Group' } 110 | 'False' { $Administratorbasegroup = 'User' } 111 | } 112 | Section -ExcludeFromTOC -Style NOTOCHeading6 $Administrator.Base.Name { 113 | $OutObj = @() 114 | $inObj = [ordered] @{ 115 | 'Name' = $Administrator.base.Name 116 | 'First Name' = $Administrator.base.FirstName 117 | 'Last Name' = $Administrator.base.LastName 118 | 'Login Name' = $Administrator.base.LoginName 119 | 'Display Name' = $Administrator.base.DisplayName 120 | 'Long Display Name' = $Administrator.base.LongDisplayName 121 | 'Is Assignment a Group of User' = $Administratorbasegroup 122 | 'Domain' = $Administrator.base.Domain 123 | 'AD Distinguished Name' = $Administrator.base.AdDistinguishedName 124 | 'Email' = $Administrator.base.Email 125 | 'Kiosk User' = $Administrator.base.KioskUser 126 | 'Un-Authenticated User' = $Administrator.base.UnauthenticatedUser 127 | 'Phone Number' = $Administrator.base.Phone 128 | 'Description' = $Administrator.base.Description 129 | 'in Folder' = $Administrator.base.InFolder 130 | 'UPN' = $Administrator.base.UserPrincipalName 131 | 'Permission Role' = [string](($RoleIDName.split(', ') | Select-Object -Unique) -join ', ') 132 | } 133 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 134 | 135 | $TableParams = @{ 136 | Name = "Administrator - $($Administrator.base.Name)" 137 | List = $true 138 | ColumnWidths = 40, 60 139 | } 140 | 141 | if ($Report.ShowTableCaptions) { 142 | $TableParams['Caption'] = "- $($TableParams.Name)" 143 | } 144 | $OutObj | Table @TableParams 145 | } 146 | } 147 | } 148 | } 149 | } catch { 150 | Write-PScriboMessage -IsWarning $_.Exception.Message 151 | } 152 | } 153 | } 154 | } 155 | } catch { 156 | Write-PScriboMessage -IsWarning $_.Exception.Message 157 | } 158 | } 159 | end {} 160 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZCertMgmt.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZCertMgmt { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Certificate Management InfoLevel set at $($InfoLevel.Settings.Servers.ConnectionServers.ConnectionServers)." 27 | Write-PScriboMessage "Collecting Certificate Management information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($ConnectionServersHealth) { 33 | if ($InfoLevel.Settings.CloudPodArch.CloudPodArch -ge 1) { 34 | # Connection Server Health Data 35 | $ConnectionServerHealthData = $ConnectionServersHealth | Select-Object -First 1 36 | 37 | Section -Style Heading2 "Certificate Management" { 38 | Paragraph "The following section details on the certificate management information for $($HVEnvironment.toUpper())." 39 | BlankLine 40 | $OutObj = @() 41 | Write-PScriboMessage "Working on Certificate Information for $($ConnectionServerHealthData.Name)." 42 | 43 | $Cert = $ConnectionServerHealthData.CertificateHealth.ConnectionServerCertificate 44 | $Bytes = [System.Text.Encoding]::UTF8.GetBytes($Cert) 45 | $PodCert = [System.Security.Cryptography.X509Certificates.X509Certificate2]::new($Bytes) 46 | 47 | $inObj = [ordered] @{ 48 | 'Self-Signed Certificate' = $ConnectionServerHealthData.DefaultCertificate 49 | 'Certificate Subject' = $PodCert.Subject 50 | 'Certificate Issuer' = $PodCert.Issuer 51 | 'Certificate Not Before' = $PodCert.NotBefore 52 | 'Certificate Not After' = $PodCert.NotAfter 53 | 'Certificate SANs' = $PodCert.DnsNameList 54 | 'Certificate Thumbprint' = $PodCert.Thumbprint 55 | } 56 | $OutObj = [pscustomobject](ConvertTo-HashToYN $inObj) 57 | if ($HealthCheck.ConnectionServers.Status) { 58 | $OutObj | Where-Object { $_.'Enabled' -eq 'No' } | Set-Style -Style Warning -Property 'Enabled' 59 | } 60 | $TableParams = @{ 61 | Name = "Certificate Management - $($HVEnvironment.toUpper())" 62 | List = $true 63 | ColumnWidths = 30, 70 64 | } 65 | if ($Report.ShowTableCaptions) { 66 | $TableParams['Caption'] = "- $($TableParams.Name)" 67 | } 68 | $OutObj | Table @TableParams 69 | } 70 | } 71 | } 72 | } catch { 73 | Write-PScriboMessage -IsWarning $_.Exception.Message 74 | } 75 | } 76 | end {} 77 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZCloudPod.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZCloudPod { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Cloud Pod Architecture InfoLevel set at $($InfoLevel.Settings.CloudPodArch.CloudPodArch)." 27 | Write-PScriboMessage "Collecting Cloud Pod Architecture information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($CloudPodFederation) { 33 | if ($InfoLevel.Settings.CloudPodArch.CloudPodArch -ge 1) { 34 | Section -Style Heading2 "Cloud Pod Architecture" { 35 | Paragraph "The following section details on the cloud pod architecture information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($CloudPodList in $CloudPodLists) { 39 | if ($CloudPodList) { 40 | 41 | # CP Site Info 42 | $CloudPodSiteInfo = $hzServices.Site.Site_Get($CloudPodList.site) 43 | 44 | # Connection Server Info 45 | $CloudPodListEndpoints = $CloudPodList.Endpoints 46 | $CloudPodListEndpointConnectionServerList = '' 47 | foreach ($CloudPodListEndpoint in $CloudPodListEndpoints) { 48 | $CloudPodListEndpointConnectionServer = $hzServices.PodEndpoint.PodEndpoint_Get($CloudPodListEndpoint) 49 | $CloudPodListEndpointConnectionServerList += $CloudPodListEndpointConnectionServer.name -join "`r`n" | Out-String 50 | } 51 | 52 | # Active Global Entitlements 53 | $CloudPodListActiveGlobalEntitlements = $CloudPodList.ActiveGlobalEntitlements 54 | $CloudPodListActiveGlobalEntitlementList = '' 55 | foreach ($CloudPodListActiveGlobalEntitlement in $CloudPodListActiveGlobalEntitlements) { 56 | $CloudPodListActiveGlobalEntitlementInfo = $hzServices.GlobalEntitlement.GlobalEntitlement_Get($CloudPodListActiveGlobalEntitlement) 57 | $CloudPodListActiveGlobalEntitlementList += $CloudPodListActiveGlobalEntitlementInfo.Base.DisplayName -join "`r`n" | Out-String 58 | } 59 | 60 | # Active Global Application Entitlements 61 | $CloudPodListActiveGlobalApplicationEntitlements = $CloudPodList.ActiveGlobalApplicationEntitlements 62 | $CloudPodListActiveGlobalApplicationEntitlementList = '' 63 | foreach ($CloudPodListActiveGlobalApplicationEntitlement in $CloudPodListActiveGlobalApplicationEntitlements) { 64 | $CloudPodListActiveGlobalApplicationEntitlementInfo = $hzServices.GlobalApplicationEntitlement.GlobalApplicationEntitlement_Get($CloudPodListActiveGlobalApplicationEntitlement) 65 | $CloudPodListActiveGlobalApplicationEntitlementList += $CloudPodListActiveGlobalApplicationEntitlementInfo.Base.DisplayName -join "`r`n" | Out-String 66 | } 67 | 68 | 69 | Write-PScriboMessage "Discovered Cloud Pod Federation Information." 70 | $inObj = [ordered] @{ 71 | 'Pod Name' = $CloudPodList.DisplayName 72 | 'Pod Local' = $CloudPodList.Localpod 73 | 'Pod Site' = $CloudPodSiteInfo.Base.DisplayName 74 | 'Pod Description' = $CloudPodList.Description 75 | 'Pod Cloud Managed' = $CloudPodList.CloudManaged 76 | 'Pod Connection Servers' = $CloudPodListEndpointConnectionServerList 77 | 'Pod Active Global Entitlements' = $CloudPodListActiveGlobalEntitlementList 78 | 'Pod Active Global Application Entitlements' = $CloudPodListActiveGlobalApplicationEntitlementList 79 | } 80 | 81 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 82 | } 83 | } 84 | 85 | $TableParams = @{ 86 | Name = "Cloud Pod Architecture - $($HVEnvironment.toUpper())" 87 | List = $true 88 | ColumnWidths = 50, 50 89 | } 90 | 91 | if ($Report.ShowTableCaptions) { 92 | $TableParams['Caption'] = "- $($TableParams.Name)" 93 | } 94 | $OutObj | Table @TableParams 95 | } 96 | } 97 | } 98 | } catch { 99 | Write-PScriboMessage -IsWarning $_.Exception.Message 100 | } 101 | } 102 | end {} 103 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZDatastore.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZDatastore { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Datastore InfoLevel set at $($InfoLevel.Settings.Servers.vCenterServers.DataStores)." 27 | Write-PScriboMessage "Collecting DataStores information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($vCenterHealth) { 33 | if ($InfoLevel.Settings.Servers.vCenterServers.DataStores -ge 1) { 34 | Section -Style NOTOCHeading5 "Datastores" { 35 | $OutObj = @() 36 | $Datastores = $vCenterHealth.datastoredata 37 | foreach ($DataStore in $Datastores) { 38 | if ($DataStore.Name) { 39 | try { 40 | Write-PScriboMessage "Discovered Datastore Information from $($DataStore.name)." 41 | $inObj = [ordered] @{ 42 | 'Name' = $DataStore.name 43 | 'Accessible' = $DataStore.Accessible 44 | } 45 | 46 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 47 | } catch { 48 | Write-PScriboMessage -IsWarning $_.Exception.Message 49 | } 50 | } 51 | } 52 | 53 | if ($HealthCheck.DataStores.Status) { 54 | $OutObj | Where-Object { $_.'Accessible' -eq 'No' } | Set-Style -Style Warning 55 | } 56 | 57 | $TableParams = @{ 58 | Name = "Datastores - $($HVEnvironment.toUpper())" 59 | List = $false 60 | ColumnWidths = 50, 50 61 | } 62 | 63 | if ($Report.ShowTableCaptions) { 64 | $TableParams['Caption'] = "- $($TableParams.Name)" 65 | } 66 | $OutObj | Sort-Object -Property 'Name' | Table @TableParams 67 | try { 68 | if ($InfoLevel.Settings.Servers.vCenterServers.DataStores -ge 2) { 69 | Section -Style NOTOCHeading6 "Datastores Detailed" { 70 | foreach ($DataStore in $Datastores) { 71 | if ($DataStore) { 72 | try { 73 | Section -ExcludeFromTOC -Style NOTOCHeading6 "$($DataStore.Name)" { 74 | $OutObj = @() 75 | Write-PScriboMessage "Discovered Datastore Information from $($DataStore.Name)." 76 | $inObj = [ordered] @{ 77 | 'Path' = $DataStore.Path 78 | 'Type' = $DataStore.DataStoreType 79 | 'Capacity' = "$([math]::round($DataStore.CapacityMB / 1KB))GB" 80 | 'Free Space' = "$([math]::round($DataStore.FreeSpaceMB / 1KB))GB" 81 | 'Accessible' = $DataStore.Accessible 82 | } 83 | 84 | $OutObj = [pscustomobject](ConvertTo-HashToYN $inObj) 85 | 86 | if ($HealthCheck.DataStores.Status) { 87 | $OutObj | Where-Object { $_.'Accessible' -eq 'No' } | Set-Style -Style Warning -Property 'Accessible' 88 | } 89 | 90 | $TableParams = @{ 91 | Name = "Datastores Details - $($DataStore.Name)" 92 | List = $true 93 | ColumnWidths = 50, 50 94 | } 95 | 96 | if ($Report.ShowTableCaptions) { 97 | $TableParams['Caption'] = "- $($TableParams.Name)" 98 | } 99 | $OutObj | Table @TableParams 100 | } 101 | } catch { 102 | Write-PScriboMessage -IsWarning $_.Exception.Message 103 | } 104 | } 105 | } 106 | } 107 | } 108 | } catch { 109 | Write-PScriboMessage -IsWarning $_.Exception.Message 110 | } 111 | } 112 | } 113 | } 114 | } catch { 115 | Write-PScriboMessage -IsWarning $_.Exception.Message 116 | } 117 | } 118 | end {} 119 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZDomain.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZDomain { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "InstantCloneDomainAccounts InfoLevel set at $($InfoLevel.Settings.InstantClone.InstantCloneDomainAccounts)." 27 | Write-PScriboMessage "Collecting Instant Clone Domain Accounts information." 28 | } 29 | 30 | process { 31 | try { 32 | Section -Style Heading2 "Domains" { 33 | if ($InstantCloneDomainAdmins) { 34 | if ($InfoLevel.Settings.InstantClone.InstantCloneDomainAccounts -ge 1) { 35 | Section -Style Heading3 "Domain Accounts" { 36 | Paragraph "The following section details the Domain Accounts configuration for $($HVEnvironment.toUpper()) server." 37 | BlankLine 38 | $OutObj = @() 39 | foreach ($InstantCloneDomainAdmin in $InstantCloneDomainAdmins) { 40 | try { 41 | Write-PScriboMessage "Discovered Domain Accounts Information." 42 | $inObj = [ordered] @{ 43 | 'User Name' = $InstantCloneDomainAdmin.Base.UserName 44 | 'Domain Name' = $InstantCloneDomainAdmin.NamesData.DnsName 45 | } 46 | 47 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 48 | } catch { 49 | Write-PScriboMessage -IsWarning $_.Exception.Message 50 | } 51 | } 52 | 53 | $TableParams = @{ 54 | Name = "Domain Accounts - $($HVEnvironment.toUpper())" 55 | List = $false 56 | ColumnWidths = 50, 50 57 | } 58 | 59 | if ($Report.ShowTableCaptions) { 60 | $TableParams['Caption'] = "- $($TableParams.Name)" 61 | } 62 | $OutObj | Sort-Object -Property 'User Name' | Table @TableParams 63 | } 64 | } 65 | } 66 | if ($Domains) { 67 | if ($InfoLevel.Settings.Servers.vCenterServers.ADDomains -ge 1) { 68 | Section -Style Heading3 "Connection Server Domain Status" { 69 | Paragraph "The following section shows connection servers domains for $($HVEnvironment.toUpper()) environment." 70 | BlankLine 71 | $OutObj = @() 72 | foreach ($Domain in $Domains) { 73 | try { 74 | Write-PScriboMessage "Discovered Domain Information $($Domain.DNSName)." 75 | $inObj = [ordered] @{ 76 | 'Domain DNS Name' = $Domain.DNSName 77 | 'Status' = $Domain.ConnectionServerState[0].Status 78 | 'Trust Relationship' = $Domain.ConnectionServerState[0].TrustRelationship 79 | 'Connection Status' = $Domain.ConnectionServerState[0].Contactable 80 | 81 | } 82 | 83 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 84 | } catch { 85 | Write-PScriboMessage -IsWarning $_.Exception.Message 86 | } 87 | } 88 | 89 | if ($HealthCheck.DataStores.Status) { 90 | $OutObj | Where-Object { $_.'Status' -eq 'ERROR' } | Set-Style -Style Warning 91 | } 92 | 93 | $TableParams = @{ 94 | Name = "Connection Server Domain Status- $($HVEnvironment.toUpper())" 95 | List = $false 96 | ColumnWidths = 25, 25, 25, 25 97 | } 98 | 99 | if ($Report.ShowTableCaptions) { 100 | $TableParams['Caption'] = "- $($TableParams.Name)" 101 | } 102 | $OutObj | Sort-Object -Property 'Name' | Table @TableParams 103 | } 104 | } 105 | } 106 | } 107 | 108 | } catch { 109 | Write-PScriboMessage -IsWarning $_.Exception.Message 110 | } 111 | } 112 | end {} 113 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZESXi.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZESXi { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Esxi Servers InfoLevel set at $($InfoLevel.Settings.Servers.vCenterServers.ESXiHosts)." 27 | Write-PScriboMessage "Collecting Esxi Servers information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($vCenterHealth) { 33 | if ($InfoLevel.Settings.Servers.vCenterServers.ESXiHosts -ge 1) { 34 | Section -Style NOTOCHeading5 "ESXi Hosts" { 35 | Paragraph "The following section details the hardware information of ESXi Hosts for $($HVEnvironment.toUpper()) server." 36 | BlankLine 37 | $ESXHosts = $vCenterHealth.hostdata 38 | foreach ($ESXCLUSTER in ($ESXHosts.ClusterName | Select-Object -Unique)) { 39 | Section -Style NOTOCHeading5 "$($ESXCLUSTER) Cluster" { 40 | $OutObj = @() 41 | try { 42 | foreach ($ESXHost in ($ESXHosts | Where-Object { $_.ClusterName -eq $ESXCLUSTER })) { 43 | Write-PScriboMessage "Discovered ESXI Server Information from $($ESXCLUSTER)." 44 | $inObj = [ordered] @{ 45 | 'Name' = $ESXHost.Name 46 | 'Version' = $ESXHost.Version 47 | 'API Version' = $ESXHost.APIVersion 48 | 'Status' = $ESXHost.Status 49 | } 50 | 51 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 52 | } 53 | if ($HealthCheck.ESXiHosts.Status) { 54 | $OutObj | Where-Object { $_.'Status' -ne 'CONNECTED' } | Set-Style -Style Warning 55 | } 56 | } catch { 57 | Write-PScriboMessage -IsWarning $_.Exception.Message 58 | } 59 | 60 | $TableParams = @{ 61 | Name = "ESXI Hosts - $($ESXCLUSTER)" 62 | List = $false 63 | ColumnWidths = 25, 25, 25, 25 64 | } 65 | 66 | if ($Report.ShowTableCaptions) { 67 | $TableParams['Caption'] = "- $($TableParams.Name)" 68 | } 69 | $OutObj | Sort-Object -Property 'Name' | Table @TableParams 70 | try { 71 | if ($InfoLevel.Settings.Servers.vCenterServers.ESXiHosts -ge 2) { 72 | foreach ($ESXHost in ($ESXHosts | Where-Object { $_.ClusterName -eq $ESXCLUSTER })) { 73 | if ($ESXHost.Name) { 74 | try { 75 | Section -ExcludeFromTOC -Style NOTOCHeading6 "$($ESXHost.Name) Details" { 76 | Write-PScriboMessage "Discovered ESXI Server Information from $($ESXHost.Name)." 77 | $inObj = [ordered] @{ 78 | 'CPU Cores' = $ESXHost.NumCpuCores 79 | 'CPU in Mhz' = $ESXHost.CpuMhz 80 | 'Memory Size' = "$([math]::round($ESXHost.MemorySizeBytes / 1GB))GB" 81 | 'vGPU Types' = $ESXHost.VGPUTypes 82 | 'VDI Machines' = $ESXHost.NumMachines 83 | } 84 | 85 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 86 | 87 | $TableParams = @{ 88 | Name = "ESXI Hosts - $($ESXHost.Name)" 89 | List = $true 90 | ColumnWidths = 50, 50 91 | } 92 | 93 | if ($Report.ShowTableCaptions) { 94 | $TableParams['Caption'] = "- $($TableParams.Name)" 95 | } 96 | $OutObj | Table @TableParams 97 | } 98 | } catch { 99 | Write-PScriboMessage -IsWarning $_.Exception.Message 100 | } 101 | } 102 | } 103 | } 104 | } catch { 105 | Write-PScriboMessage -IsWarning $_.Exception.Message 106 | } 107 | } 108 | } 109 | } 110 | } 111 | } 112 | } catch { 113 | Write-PScriboMessage -IsWarning $_.Exception.Message 114 | } 115 | } 116 | end {} 117 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZEventConf.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZEventConf { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "EventDatabase InfoLevel set at $($InfoLevel.Settings.EventConfiguration.EventDatabase)." 27 | Write-PScriboMessage "Collecting Event Configuration information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($EventDataBases -or $Syslog) { 33 | if ($InfoLevel.Settings.EventConfiguration.PSObject.Properties.Value -ne 0) { 34 | Section -Style Heading2 "Event Configuration" { 35 | Paragraph "The following section details on the events configuration information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | if ($InfoLevel.Settings.EventConfiguration.EventDatabase -ge 1) { 38 | try { 39 | Section -Style Heading3 "Event Database" { 40 | $OutObj = @() 41 | foreach ($EventDataBase in $EventDataBases) { 42 | Write-PScriboMessage "Discovered Event Database Information." 43 | $inObj = [ordered] @{ 44 | 'Server' = $EventDataBase.database.Server 45 | 'Type' = $EventDataBase.database.Type 46 | 'Port' = $EventDataBase.database.Port 47 | 'Name' = $EventDataBase.database.Name 48 | 'User Name' = $EventDataBase.database.UserName 49 | 'Table Prefix' = $EventDataBase.database.TablePrefix 50 | 'Show Events for' = $EventDataBase.Settings.ShowEventsForTime 51 | 'Classify Events as New for' = "$($EventDataBase.Settings.ClassifyEventsAsNewForDays) Days" 52 | 'Timing Profiler Events' = "$($EventDataBase.Settings.TimingProfilerDataLongevity) Days" 53 | 'Enabled' = $EventDataBases.EventDatabaseSet 54 | } 55 | 56 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 57 | } 58 | 59 | if ($HealthCheck.EventConfiguration.EventDatabase) { 60 | $OutObj | Where-Object { $_.'Enabled' -eq 'No' } | Set-Style -Style Warning -Property 'Enabled' 61 | } 62 | 63 | $TableParams = @{ 64 | Name = "Event Database - $($HVEnvironment.split(".").toUpper()[0])" 65 | List = $true 66 | ColumnWidths = 50, 50 67 | } 68 | 69 | if ($Report.ShowTableCaptions) { 70 | $TableParams['Caption'] = "- $($TableParams.Name)" 71 | } 72 | $OutObj | Table @TableParams 73 | } 74 | } catch { 75 | Write-PScriboMessage -IsWarning $_.Exception.Message 76 | } 77 | } 78 | if ($InfoLevel.Settings.EventConfiguration.Syslog -ge 1 -and $Syslog.UdpData.Enabled) { 79 | try { 80 | Section -Style Heading3 "Syslog Configuration" { 81 | $OutObj = @() 82 | foreach ($Logging in $Syslog.UdpData.NetworkAddresses) { 83 | Write-PScriboMessage "Discovered Syslog Information." 84 | $inObj = [ordered] @{ 85 | 'Server' = $Logging.split(':')[0] 86 | 'Port' = $Logging.split(':')[1] 87 | } 88 | 89 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 90 | } 91 | 92 | $TableParams = @{ 93 | Name = "Syslog Configuration - $($HVEnvironment.split(".").toUpper()[0])" 94 | List = $false 95 | ColumnWidths = 50, 50 96 | } 97 | 98 | if ($Report.ShowTableCaptions) { 99 | $TableParams['Caption'] = "- $($TableParams.Name)" 100 | } 101 | $OutObj | Sort-Object -Property 'Server' | Table @TableParams 102 | } 103 | } catch { 104 | Write-PScriboMessage -IsWarning $_.Exception.Message 105 | } 106 | } 107 | if ($InfoLevel.Settings.EventConfiguration.EventstoFileSystem -ge 1 -and ($Syslog.FileData.Enabled -or $Syslog.FileData.EnabledOnError)) { 108 | try { 109 | Section -Style Heading3 "Events to File System" { 110 | $OutObj = @() 111 | foreach ($Logging in $Syslog) { 112 | Write-PScriboMessage "Discovered Events to File System Information." 113 | $inObj = [ordered] @{ 114 | 'Enabled' = $Logging.FileData.Enabled 115 | 'Enabled on Error' = $Logging.FileData.EnabledOnError 116 | 'Path' = $Logging.FileData.UncPath 117 | 'User name' = $Logging.FileData.UncUserName 118 | 'Domain' = $Logging.FileData.UncDomain 119 | } 120 | 121 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 122 | } 123 | 124 | $TableParams = @{ 125 | Name = "Events to File System - $($HVEnvironment.split(".").toUpper()[0])" 126 | List = $true 127 | ColumnWidths = 50, 50 128 | } 129 | 130 | if ($Report.ShowTableCaptions) { 131 | $TableParams['Caption'] = "- $($TableParams.Name)" 132 | } 133 | $OutObj | Table @TableParams 134 | } 135 | } catch { 136 | Write-PScriboMessage -IsWarning $_.Exception.Message 137 | } 138 | } 139 | } 140 | } 141 | } 142 | } catch { 143 | Write-PScriboMessage -IsWarning $_.Exception.Message 144 | } 145 | } 146 | end {} 147 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZFederationAccessGroup.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZFederationAccessGroup { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Role Permissions InfoLevel set at $($InfoLevel.Settings.Administrators.RolePermissions)." 27 | Write-PScriboMessage "Collecting Role Federation Access Groups information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($Permissions) { 33 | if ($InfoLevel.Settings.Administrators.FederationAccessGroup -ge 1) { 34 | Section -Style Heading3 "Federation Access Groups" { 35 | Paragraph "The following section details the Federation Access Group information for $($HVEnvironment.toUpper()) server." 36 | BlankLine 37 | $OutObj = @() 38 | 39 | $FilteredPermissions = '' 40 | $FilteredPermissions = $Permissions | Where-Object { $null -ne $_.base.GlobalAccessGroup } 41 | 42 | foreach ($Permission in $FilteredPermissions) { 43 | 44 | $AdministratorIDNameResults = '' 45 | # Find Administrator ID Name 46 | $AdministratorIDName = '' 47 | $PermissionGroups = $Permission.base.UserOrGroup.id 48 | foreach ($PermissionGroup in $PermissionGroups) { 49 | foreach ($Administrator in $Administrators) { 50 | if ($Administrator.Id.id -eq $PermissionGroup) { 51 | $AdministratorIDName = $Administrator.base.name 52 | break 53 | } 54 | } 55 | if ($PermissionGroups.count -gt 1) { 56 | $AdministratorIDNameResults += "$AdministratorIDName, " 57 | $AdministratorIDName = $AdministratorIDNameResults.TrimEnd(', ') 58 | } 59 | } 60 | Switch ($AdministratorIDName) { 61 | '' { $AdministratorIDName = 'N/A' } 62 | ' ' { $AdministratorIDName = 'N/A' } 63 | } 64 | 65 | # Mach Permission Role ID with Role ID 66 | # Find Role ID Name 67 | $RoleIDName = '' 68 | $PermissionGroups = $Permission.base.Role.id 69 | foreach ($PermissionGroup in $PermissionGroups) { 70 | 71 | foreach ($Role in $Roles) { 72 | if ($Role.Id.id -eq $PermissionGroup) { 73 | $RoleIDName = $Role.base.name 74 | break 75 | } 76 | 77 | } 78 | if ($PermissionGroups.count -gt 1) { 79 | $RoleIDNameResults += "$RoleIDName, " 80 | $RoleIDName = $RoleIDNameResults.TrimEnd(', ') 81 | $RoleIDName = [string](($RoleIDName.split(', ') | Select-Object -Unique) -join ', ') 82 | } 83 | } 84 | 85 | # Find AccessGroup ID Name 86 | $GlobalAccessGroupIDName = '' 87 | $PermissionGroups = $Permission.base.GlobalAccessGroup.id 88 | if ($PermissionGroups) { 89 | foreach ($PermissionGroup in $PermissionGroups) { 90 | if ($PermissionGroup) { 91 | if ($GlobalAccessGroups) { 92 | foreach ($GlobalAccessGroup in $GlobalAccessGroups) { 93 | if ($GlobalAccessGroup) { 94 | if ($GlobalAccessGroup.Id.id -eq $PermissionGroup) { 95 | $GlobalAccessGroupIDName = "/$($GlobalAccessGroup.base.name)" 96 | } elseif ($GlobalAccessGroup.Children.id.id -eq $PermissionGroup) { 97 | $GlobalAccessGroupIDName = "/Root/$(($AccessGroup.Children | Where-Object {$_.id.id -eq $PermissionGroup}).Base.Name)" 98 | } 99 | $GlobalAccessGroupIDName = $GlobalAccessGroupIDName.TrimStart('/') 100 | } 101 | } 102 | } 103 | } 104 | } 105 | } 106 | $inObj = [ordered] @{ 107 | 'User or Group Name' = $AdministratorIDName 108 | 'Role' = $RoleIDName 109 | 'Global Access Group' = $GlobalAccessGroupIDName 110 | } 111 | 112 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 113 | } 114 | $TableParams = @{ 115 | Name = "Role Permissions - $($HVEnvironment.toUpper())" 116 | List = $false 117 | ColumnWidths = 33, 33, 34 118 | } 119 | 120 | if ($Report.ShowTableCaptions) { 121 | $TableParams['Caption'] = "- $($TableParams.Name)" 122 | } 123 | $OutObj | Sort-Object -Property 'User or Group Name' | Table @TableParams 124 | 125 | 126 | 127 | } 128 | } 129 | } 130 | } catch { 131 | Write-PScriboMessage -IsWarning $_.Exception.Message 132 | } 133 | } 134 | end {} 135 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZGatewayCert.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZGatewayCert { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Gatway Certificate InfoLevel set at $($InfoLevel.Settings.Servers.ConnectionServers.ConnectionServers)." 27 | Write-PScriboMessage "Collecting Gatway Certificate information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($GatewayCerts) { 33 | if ($InfoLevel.Settings.CloudPodArch.CloudPodArch -ge 1) { 34 | Section -Style Heading3 "Gateway Certificate" { 35 | Paragraph "The following section details on the gateway certificate information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | Write-PScriboMessage "Working on Gateway Certificate Information for $($HVEnvironment.toUpper())." 38 | $OutObj = @() 39 | foreach ($GatewayCert in $GatewayCerts) { 40 | $inObj = [ordered] @{ 41 | 'Certificate Name' = $GatewayCert.CertificateName 42 | 'Common Name' = $GatewayCert.CommonName 43 | 'Issuer' = $GatewayCert.Issuer 44 | 'Expiry Date' = $GatewayCert.ExpiryDate 45 | 'Serial Number' = $GatewayCert.SerialNum 46 | } 47 | $OutObj = [pscustomobject](ConvertTo-HashToYN $inObj) 48 | } 49 | $TableParams = @{ 50 | Name = "Gateway Certificate - $($HVEnvironment.toUpper())" 51 | List = $true 52 | ColumnWidths = 30, 70 53 | } 54 | if ($Report.ShowTableCaptions) { 55 | $TableParams['Caption'] = "- $($TableParams.Name)" 56 | } 57 | $OutObj | Table @TableParams 58 | } 59 | } 60 | } 61 | } catch { 62 | Write-PScriboMessage -IsWarning $_.Exception.Message 63 | } 64 | } 65 | end {} 66 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZGlobalPolicy.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZGlobalpolicy { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Global Policies InfoLevel set at $($InfoLevel.Settings.GlobalPolicies.GlobalPolicies)." 27 | Write-PScriboMessage "Collecting Global Policies information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($GlobalPolicies) { 33 | if ($InfoLevel.Settings.GlobalPolicies.GlobalPolicies -ge 1) { 34 | Section -Style Heading2 "Global Policies" { 35 | Paragraph "The following section details on the Global Policies information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | 39 | Write-PScriboMessage "Discovered Global Policies Information." 40 | $inObj = [ordered] @{ 41 | 'Allow Multimedia Redirection' = $GlobalPolicies.GlobalPolicies.AllowMultimediaRedirection 42 | 'Allow USB Access' = $GlobalPolicies.GlobalPolicies.AllowUSBAccess 43 | 'Allow Remote Mode' = $GlobalPolicies.GlobalPolicies.AllowRemoteMode 44 | 'Allow PCoIP Hardware Acceleration' = $GlobalPolicies.GlobalPolicies.AllowPCoIPHardwareAcceleration 45 | 'PCoIP Hardware Acceleration Priority' = $GlobalPolicies.GlobalPolicies.PcoipHardwareAccelerationPriority 46 | } 47 | 48 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 49 | 50 | $TableParams = @{ 51 | Name = "Global Policies - $($HVEnvironment.toUpper())" 52 | List = $true 53 | ColumnWidths = 50, 50 54 | } 55 | 56 | if ($Report.ShowTableCaptions) { 57 | $TableParams['Caption'] = "- $($TableParams.Name)" 58 | } 59 | $OutObj | Table @TableParams 60 | } 61 | } 62 | } 63 | } catch { 64 | Write-PScriboMessage -IsWarning $_.Exception.Message 65 | } 66 | } 67 | end {} 68 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZGlobalSetting.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZGlobalSetting { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "GlobalSettings InfoLevel set at $($InfoLevel.Settings.GlobalSettings.GlobalSettings)." 27 | Write-PScriboMessage "Collecting Global Settings information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($GlobalSettings.GeneralData) { 33 | if ($InfoLevel.Settings.GlobalSettings.GlobalSettings -ge 1) { 34 | Section -Style Heading2 "Global Settings" { 35 | Paragraph "The following section details the Global Settings configuration for $($HVEnvironment.toUpper()) server." 36 | BlankLine 37 | Section -Style Heading3 "General Settings" { 38 | $OutObj = @() 39 | Write-PScriboMessage "Discovered Global Settings Information." 40 | $inObj = [ordered] @{ 41 | 'Client Session Time Out Policy' = $GlobalSettings.GeneralData.ClientIdleSessionTimeoutPolicy 42 | 'Client Max Session Time Minutes ' = $GlobalSettings.GeneralData.ClientMaxSessionTimeMinutes 43 | 'Client Idle Session Timeout Policy' = $GlobalSettings.GeneralData.ClientIdleSessionTimeoutPolicy 44 | 'Client Idle Session Timeout Minutes' = $GlobalSettings.GeneralData.ClientIdleSessionTimeoutMinutes 45 | 'Client Session Timeout Minutes ' = $GlobalSettings.GeneralData.ClientSessionTimeoutMinutes 46 | 'Desktop SSO Timeout Policy' = $GlobalSettings.GeneralData.DesktopSSOTimeoutPolicy 47 | 'Desktop SSO Timeout Minutes' = $GlobalSettings.GeneralData.DesktopSSOTimeoutMinutes 48 | 'Application SSO Timeout Policy' = $GlobalSettings.GeneralData.ApplicationSSOTimeoutPolicy 49 | 'Application SSO Timeout Minutes' = $GlobalSettings.GeneralData.ApplicationSSOTimeoutMinutes 50 | 'View API Session Timeout Minutes' = $GlobalSettings.GeneralData.ViewAPISessionTimeoutMinutes 51 | 'Pre-Login Message' = $GlobalSettings.GeneralData.PreLoginMessage 52 | 'Display Warning Before Forced Logoff' = $GlobalSettings.GeneralData.DisplayWarningBeforeForcedLogoff 53 | 'Forced Logoff Timeout Minutes' = $GlobalSettings.GeneralData.ForcedLogoffTimeoutMinutes 54 | 'Forced Logoff Message' = $GlobalSettings.GeneralData.ForcedLogoffMessage 55 | 'Enable Server in Single User Mode' = $GlobalSettings.GeneralData.EnableServerInSingleUserMode 56 | 'Store CAL on Broker' = $GlobalSettings.GeneralData.StoreCALOnBroker 57 | 'Store CAL on Client' = $GlobalSettings.GeneralData.StoreCALOnClient 58 | 'Enable UI User Name Caching' = $GlobalSettings.GeneralData.EnableUIUserNameCaching 59 | 'Console Session Timeout in Minutes' = $GlobalSettings.GeneralData.ConsoleSessionTimeoutMinutes 60 | 'Enable Automatic Status Updates' = $GlobalSettings.GeneralData.EnableAutomaticStatusUpdates 61 | 'Send Domain List' = $GlobalSettings.GeneralData.SendDomainList 62 | 'Enable Credential Cleanup for HTML Access' = $GlobalSettings.GeneralData.EnableCredentialCleanupForHTMLAccess 63 | 'Hide Server Information In Client' = $GlobalSettings.GeneralData.HideServerInformationInClient 64 | 'Hide Domain List In Client' = $GlobalSettings.GeneralData.HideDomainListInClient 65 | 'Enable Multi Factor Reauthentication' = $GlobalSettings.GeneralData.EnableMultiFactorReAuth 66 | 'Disconnect Warning Time' = $GlobalSettings.GeneralData.DisconnectWarningTime 67 | 'Disconnect Warning Message' = $GlobalSettings.GeneralData.DisconnectWarningMessage 68 | 'Disconnect Message' = $GlobalSettings.GeneralData.DisconnectMessage 69 | 'Display Pre-login Admin Banner' = $GlobalSettings.GeneralData.DisplayPreLoginAdminBanner 70 | 'Pre-Login Admin Banner Header' = $GlobalSettings.GeneralData.PreLoginAdminBannerHeader 71 | 'Pre-Login Admin Banner Message' = $GlobalSettings.GeneralData.PreLoginAdminBannerMessage 72 | 'Enforce CSRF Protection' = $GlobalSettings.GeneralData.EnorceCSRFProtection 73 | 'Enforce E2E Encryption' = $GlobalSettings.GeneralData.EnforceE2EEncryption 74 | 75 | 76 | } 77 | 78 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 79 | 80 | $TableParams = @{ 81 | Name = "Global Settings - $($HVEnvironment.toUpper())" 82 | List = $true 83 | ColumnWidths = 50, 50 84 | } 85 | 86 | if ($Report.ShowTableCaptions) { 87 | $TableParams['Caption'] = "- $($TableParams.Name)" 88 | } 89 | $OutObj | Table @TableParams 90 | } 91 | 92 | try { 93 | if ($InfoLevel.Settings.GlobalSettings.GlobalSettings -ge 2) { 94 | Section -Style Heading3 "Security Settings" { 95 | $OutObj = @() 96 | Write-PScriboMessage "Discovered Security Settings Information." 97 | $inObj = [ordered] @{ 98 | 'Reauthenticate Secure Tunnel After Interruption' = $GlobalSettings.SecurityData.ReauthSecureTunnelAfterInterruption 99 | 'Disallow Enhanced Security Mode' = $GlobalSettings.SecurityData.DisallowEnhancedSecurityMode 100 | 'No Managed Certs' = $GlobalSettings.SecurityData.NoManagedCerts 101 | 'Message Security Mode' = $GlobalSettings.SecurityData.MessageSecurityMode 102 | 'Message Security Status' = $GlobalSettings.SecurityData.MessageSecurityStatus 103 | 'Enable IP Sec for Security Server Pairing' = $GlobalSettings.SecurityData.EnableIPSecForSecurityServerPairing 104 | } 105 | $OutObj = [pscustomobject](ConvertTo-HashToYN $inObj) 106 | 107 | $TableParams = @{ 108 | Name = "Security Settings - $($HVEnvironment.toUpper())" 109 | List = $true 110 | ColumnWidths = 50, 50 111 | } 112 | 113 | if ($Report.ShowTableCaptions) { 114 | $TableParams['Caption'] = "- $($TableParams.Name)" 115 | } 116 | $OutObj | Table @TableParams 117 | } 118 | } 119 | } catch { 120 | Write-PScriboMessage -IsWarning $_.Exception.Message 121 | } 122 | 123 | try { 124 | if ($InfoLevel.Settings.GlobalSettings.GlobalSettings -ge 2) { 125 | Section -Style Heading3 "Client Restriction Settings" { 126 | $OutObj = @() 127 | Write-PScriboMessage "Discovered Client Restriction Settings Information." 128 | foreach ($CLientData in $GlobalSettings.ClientRestrictionConfiguration.ClientData) { 129 | $inObj = [ordered] @{ 130 | 'Type' = $CLientData.Type 131 | 'Version' = $CLientData.Version 132 | 'Warn Specific Versions' = $CLientData.WarnSpecificVersions 133 | 'Block Specific Versions' = $CLientData.BlockSpecificVersions 134 | } 135 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 136 | } 137 | 138 | $TableParams = @{ 139 | Name = "Client Restriction Settings - $($HVEnvironment.toUpper())" 140 | List = $false 141 | ColumnWidths = 25, 25, 25, 25 142 | } 143 | 144 | if ($Report.ShowTableCaptions) { 145 | $TableParams['Caption'] = "- $($TableParams.Name)" 146 | } 147 | $OutObj | Table @TableParams 148 | } 149 | } 150 | } catch { 151 | Write-PScriboMessage -IsWarning $_.Exception.Message 152 | } 153 | } 154 | } 155 | } 156 | } catch { 157 | Write-PScriboMessage -IsWarning $_.Exception.Message 158 | } 159 | } 160 | end {} 161 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZHCConnection.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZHCConnection { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module, Wouter Kursten - Health Check 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Connection Server Health Check InfoLevel set at $($HealthCheck.Components.ConnectionServers)." 27 | Write-PScriboMessage "Connection Server Health information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($ConnectionServersHealth) { 33 | if ($HealthCheck.Components.ConnectionServers) { 34 | Section -Style Heading3 "Connection Server Health Information" { 35 | Paragraph "The following section details on the connection server health information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($CSHealth in $ConnectionServersHealth) { 39 | if($CSHealth.CertificateHealth.ExpirationTime -lt ((Get-Date).AddDays(30))) { 40 | $ConServCertExpiry = "Certificate Expiring Soon" 41 | } elseif ($CSHealth.CertificateHealth.ExpirationTime -lt (Get-Date)) { 42 | $ConServCertExpiry = "Certificate Expired" 43 | } else { 44 | $ConServCertExpiry = "False" 45 | } 46 | if ($CSHealth) { 47 | Write-PScriboMessage "Connection Server Status Information." 48 | $inObj = [ordered] @{ 49 | 'Name' = $CSHealth.Name 50 | 'Status' = $CSHealth.Status 51 | 'Version' = $CSHealth.Version 52 | 'Build' = $CSHealth.Build 53 | 'Cert Valid' = $CSHealth.CertificateHealth.valid 54 | 'Cert Expiring' = $ConServCertExpiry 55 | 'Cert Expiry Date' = $CSHealth.CertificateHealth.ExpirationTime 56 | 'Cert Invalidation Reason' = $CSHealth.CertificateHealth.InvalidationReason 57 | } 58 | 59 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 60 | } 61 | } 62 | 63 | $TableParams = @{ 64 | Name = "Connection Server Health Information - $($HVEnvironment.toUpper())" 65 | List = $false 66 | ColumnWidths = 16, 8, 10, 16, 6, 10, 20, 14 67 | } 68 | 69 | if ($Report.ShowTableCaptions) { 70 | $TableParams['Caption'] = "- $($TableParams.Name)" 71 | } 72 | $OutObj | Table @TableParams 73 | } 74 | } 75 | } 76 | } catch { 77 | Write-PScriboMessage -IsWarning $_.Exception.Message 78 | } 79 | } 80 | end {} 81 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZHCDataStore.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZHCDataStore { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module, Wouter Kursten - Health Check 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Data Store Health Check InfoLevel set at $($HealthCheck.vSphere.DataStores)." 27 | Write-PScriboMessage "Data Store Health information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($vCenterHealth) { 33 | if ($HealthCheck.vSphere.DataStores) { 34 | Section -Style Heading3 "Data Store Health Information" { 35 | Paragraph "The following section details on the data store health information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($VCHealth in $vCenterHealth){ 39 | foreach ($DSHealth in $VCHealth.DatastoreData){ 40 | Write-PScriboMessage "DataStore Health Status Information." 41 | $inObj = [ordered] @{ 42 | "Datastore" = $DSHealth.name; 43 | "Accessible" = $DSHealth.accessible; 44 | "Path" = $DSHealth.path; 45 | "Datastore Type" = $DSHealth.datastoreType; 46 | "Capacity MB" = $DSHealth.capacityMB; 47 | "Free Space MB" = $DSHealth.freeSpaceMB; 48 | } 49 | 50 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 51 | } 52 | } 53 | 54 | $TableParams = @{ 55 | Name = "DataStore Health Information - $($HVEnvironment.toUpper())" 56 | List = $false 57 | ColumnWidths = 20, 12, 28, 10, 15, 15 58 | } 59 | 60 | if ($Report.ShowTableCaptions) { 61 | $TableParams['Caption'] = "- $($TableParams.Name)" 62 | } 63 | $OutObj | Table @TableParams 64 | } 65 | } 66 | } 67 | } catch { 68 | Write-PScriboMessage -IsWarning $_.Exception.Message 69 | } 70 | } 71 | end {} 72 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZHCDomain.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZHCDomain { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module, Wouter Kursten - Health Check 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Domain Health Check InfoLevel set at $($HealthCheck.OtherComponents.Domains)." 27 | Write-PScriboMessage "Domain Health information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($Domains) { 33 | if ($HealthCheck.OtherComponents.Domains) { 34 | Section -Style Heading3 "Domain Health Information" { 35 | Paragraph "The following section details on the Domain health information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($Domain in $Domains){ 39 | $TrustRel = $Domain.ConnectionServerState[0].TrustRelationship 40 | $DomainSat = $Domain.ConnectionServerState[0].Status 41 | $AllTrustRelSame = $true 42 | $AllDomainStatSame = $true 43 | 44 | foreach($CSDomainStatus in $Domain.ConnectionServerState){ 45 | if ($CSDomainStatus.TrustRelationship -ne $TrustRel) { 46 | $AllTrustRelSame = $false 47 | break 48 | } 49 | if ($CSDomainStatus.Status -ne $DomainSat) { 50 | $AllDomainStatSame = $false 51 | break 52 | } 53 | } 54 | 55 | if ($AllTrustRelSame) { 56 | $TrustOut = $TrustRel 57 | } else { 58 | $TrustOut = "Trust relationships are not identical." 59 | } 60 | if ($AllDomainStatSame) { 61 | $DomainOut = $DomainSat 62 | } else { 63 | $DomainOut = "Status is not consistent" 64 | } 65 | 66 | Write-PScriboMessage "Domain Health Status Information." 67 | $inObj = [ordered] @{ 68 | "Domain Name" = $domain.NetBiosName; 69 | "Status" = $DomainOut; 70 | "Trust Relationship" = $TrustOut; 71 | } 72 | 73 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 74 | 75 | } 76 | 77 | $TableParams = @{ 78 | Name = "Domain Health Information - $($HVEnvironment.toUpper())" 79 | List = $false 80 | ColumnWidths = 30, 35, 35 81 | } 82 | 83 | if ($Report.ShowTableCaptions) { 84 | $TableParams['Caption'] = "- $($TableParams.Name)" 85 | } 86 | $OutObj | Table @TableParams 87 | } 88 | } 89 | } 90 | } catch { 91 | Write-PScriboMessage -IsWarning $_.Exception.Message 92 | } 93 | } 94 | end {} 95 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZHCESXiHost.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZHCESXiHost { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module, Wouter Kursten - Health Check 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "ESXi Health Check InfoLevel set at $($HealthCheck.vSphere.ESXiHosts)." 27 | Write-PScriboMessage "ESXi Health information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($vCenterHealth) { 33 | if ($HealthCheck.vSphere.ESXiHosts) { 34 | Section -Style Heading3 "ESXi Health Information" { 35 | Paragraph "The following section details on the ESXi health information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($VCHealth in $vCenterHealth){ 39 | foreach ($ESXiHost in $VCHealth.hostData){ 40 | if ($esxihost.vGPUTypes){ 41 | $vGPUTypes= [system.String]::Join(",", $ESXiHost.vGPUTypes) 42 | } 43 | else{ 44 | $vGPUTypes="n/a" 45 | } 46 | Write-PScriboMessage "ESXi Health Status Information." 47 | $inObj = [ordered] @{ 48 | "ESXi Host" = $ESXiHost.name; 49 | "Version" = $ESXiHost.version; 50 | "API Version" = $ESXiHost.apiVersion; 51 | "Status" = $ESXiHost.status; 52 | "cluster Name" = $ESXiHost.clusterName; 53 | "vGPU Types" = $vGPUTypes; 54 | } 55 | 56 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 57 | } 58 | } 59 | 60 | $TableParams = @{ 61 | Name = "ESXi Health Information - $($HVEnvironment.toUpper())" 62 | List = $false 63 | ColumnWidths = 30, 10, 10, 20, 15, 15 64 | } 65 | 66 | if ($Report.ShowTableCaptions) { 67 | $TableParams['Caption'] = "- $($TableParams.Name)" 68 | } 69 | $OutObj | Table @TableParams 70 | } 71 | } 72 | } 73 | } catch { 74 | Write-PScriboMessage -IsWarning $_.Exception.Message 75 | } 76 | } 77 | end {} 78 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZHCEventDataBase.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZHCEventDataBase { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module, Wouter Kursten - Health Check 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Event Database Health Check InfoLevel set at $($HealthCheck.Components.EventDataBase)." 27 | Write-PScriboMessage "Event Database Health information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($EventDataBaseHealth) { 33 | if ($HealthCheck.Components.EventDataBase) { 34 | Section -Style Heading3 "Event Database Health Information" { 35 | Paragraph "The following section details on the event database health information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | 39 | if ($EventDataBaseHealth.configured -eq $true) { 40 | Write-PScriboMessage "Event Database Status Information." 41 | $inObj = [ordered] @{ 42 | "Server name" = $EventDataBaseHealth.data.Servername; 43 | "Port" = $EventDataBaseHealth.data.Port; 44 | "Status" = $EventDataBaseHealth.data.State; 45 | "Username" = $EventDataBaseHealth.data.Username; 46 | "Database Name" = $EventDataBaseHealth.data.DatabaseName 47 | "Table Prefix" = $EventDataBaseHealth.data.TablePrefix; 48 | "State" = $EventDataBaseHealth.data.State; 49 | "Error" = $EventDataBaseHealth.data.Error; 50 | } 51 | 52 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 53 | } 54 | 55 | 56 | $TableParams = @{ 57 | Name = "Event Database Health Information - $($HVEnvironment.toUpper())" 58 | List = $false 59 | ColumnWidths = 18, 8, 12, 16, 18, 8, 10, 10 60 | } 61 | 62 | if ($Report.ShowTableCaptions) { 63 | $TableParams['Caption'] = "- $($TableParams.Name)" 64 | } 65 | 66 | $OutObj | Table @TableParams 67 | } 68 | } 69 | } 70 | } catch { 71 | Write-PScriboMessage -IsWarning $_.Exception.Message 72 | } 73 | } 74 | end {} 75 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZHCGatewayServer.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZHCGatewayServer { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module, Wouter Kursten - Health Check 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Gateway Server Health Check InfoLevel set at $($HealthCheck.Components.GatewayServer)." 27 | Write-PScriboMessage "Gateway Server Health information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($GatewayServers) { 33 | if ($HealthCheck.Components.GatewayServer) { 34 | Section -Style Heading3 "Gateway Server Health Information" { 35 | Paragraph "The following section details on the gateway server health information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($GWServer in $GatewayServers) { 39 | if ($GWServer) { 40 | $Gatewayhealth = $hzServices.GatewayHealth.GatewayHealth_Get($GWServer.id) 41 | $lastcontact = (([System.DateTimeOffset]::FromUnixTimeMilliSeconds(($Gatewayhealth.LastUpdatedTimestamp)).DateTime).ToString("s")) 42 | Switch ($Gatewayhealth.GatewayZoneInternal) { 43 | "False" {$GateayZoneType = "External"} 44 | "True" {$GateayZoneType = "Internal"} 45 | Default{$GateayZoneType = "Lost"} 46 | } 47 | Switch ($Gatewayhealth.type) { 48 | "AP" {$GWType = "UAG"} 49 | "F5" {$GWType = "F5 Load Balanced"} 50 | Default {$GWType = "Unknown"} 51 | } 52 | 53 | Write-PScriboMessage "Gateway Server Status Information." 54 | $inObj = [ordered] @{ 55 | "UAG Name" = $Gatewayhealth.name; 56 | "UAG Address" = $Gatewayhealth.Address; 57 | "UAG Zone" = $GateayZoneType; 58 | "UAG Version" = $Gatewayhealth.Version; 59 | "UAG Type" = $GWType; 60 | "UAG Active" = $Gatewayhealth.GatewayStatusActive; 61 | "UAG Stale" = $Gatewayhealth.GatewayStatusStale; 62 | "UAG Contacted" = $Gatewayhealth.GatewayContacted; 63 | "UAG Last Contact" = $lastcontact; 64 | } 65 | 66 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 67 | } 68 | } 69 | 70 | $TableParams = @{ 71 | Name = "Gateway Server Health Information - $($HVEnvironment.toUpper())" 72 | List = $false 73 | ColumnWidths = 16, 10, 10, 10, 12, 8, 8, 12, 14 74 | } 75 | 76 | if ($Report.ShowTableCaptions) { 77 | $TableParams['Caption'] = "- $($TableParams.Name)" 78 | } 79 | 80 | $OutObj | Table @TableParams 81 | 82 | #<# 83 | $OutObj = @() 84 | foreach ($GWServer in $GatewayServers) { 85 | if ($GWServer) { 86 | $Gatewayhealth = $hzServices.GatewayHealth.GatewayHealth_Get($GWServer.id) 87 | Write-PScriboMessage "Gateway Server Connection Stats Information." 88 | $inObj = [ordered] @{ 89 | "UAG Name" = $Gatewayhealth.name; 90 | "UAG Active Connections" = $Gatewayhealth.ConnectionData.NumActiveConnections; 91 | "UAG Blast Connections" = $Gatewayhealth.ConnectionData.NumBlastConnections; 92 | "UAG PCOIP Connections" = $Gatewayhealth.ConnectionData.NumPcoipConnections; 93 | } 94 | 95 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 96 | } 97 | } 98 | 99 | $TableParams = @{ 100 | Name = "Gateway Server Health Connection Stats Information - $($HVEnvironment.toUpper())" 101 | List = $false 102 | ColumnWidths = 25, 25, 25, 25 103 | } 104 | 105 | if ($Report.ShowTableCaptions) { 106 | $TableParams['Caption'] = "- $($TableParams.Name)" 107 | } 108 | 109 | $OutObj | Table @TableParams 110 | #> 111 | } 112 | } 113 | } 114 | } catch { 115 | Write-PScriboMessage -IsWarning $_.Exception.Message 116 | } 117 | } 118 | end {} 119 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZHCLicenseService.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZHCLicenseService { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module, Wouter Kursten - Health Check 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "License Health Check InfoLevel set at $($HealthCheck.OtherComponents.LicenseService)." 27 | Write-PScriboMessage "License Health information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($ProductLicenseingInfo) { 33 | if ($HealthCheck.OtherComponents.LicenseService) { 34 | Section -Style Heading3 "License Health Information" { 35 | Paragraph "The following section details on the License health information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | 39 | $LicensedEditionEdited = $ProductLicenseingInfo.LicenseEdition -replace "_", " " 40 | $culture = [System.Globalization.CultureInfo]::CurrentCulture 41 | $textInfo = $culture.TextInfo 42 | $properCaseLicensedEditionEdited = $textInfo.ToTitleCase($LicensedEditionEdited.ToLower()) 43 | 44 | # $ProductLicenseingInfo.Licensed 45 | if ($ProductLicenseingInfo.Licensed -eq $true) { 46 | $LicStatus = "Okay" 47 | } else { 48 | $LicStatus = "Unlicensed" 49 | } 50 | 51 | Write-PScriboMessage "License Health Status Information." 52 | $inObj = [ordered] @{ 53 | "Status" = $LicStatus; 54 | "License Key" = $ProductLicenseingInfo.LicenseKey; 55 | "License Edition" = $properCaseLicensedEditionEdited; 56 | } 57 | 58 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 59 | 60 | 61 | $TableParams = @{ 62 | Name = "License Health Information - $($HVEnvironment.toUpper())" 63 | List = $false 64 | ColumnWidths = 30, 40, 30 65 | } 66 | 67 | if ($Report.ShowTableCaptions) { 68 | $TableParams['Caption'] = "- $($TableParams.Name)" 69 | } 70 | $OutObj | Table @TableParams 71 | } 72 | } 73 | } 74 | } catch { 75 | Write-PScriboMessage -IsWarning $_.Exception.Message 76 | } 77 | } 78 | end {} 79 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZHCRDSFarm.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZHCRDSFarm { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module, Wouter Kursten - Health Check 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "RDS Farms Health Check InfoLevel set at $($HealthCheck.RDSFarms.RDSFarms)." 27 | Write-PScriboMessage "RDS Farms Health information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($farms) { 33 | if ($HealthCheck.RDSFarms.RDSFarms) { 34 | Section -Style Heading3 "RDS Farms Health Information" { 35 | Paragraph "The following section details on the RDS farms health information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($Farm in $Farms) { 39 | if ($Farm) { 40 | $health=$hzServices.Farmhealth.farmhealth_get($farm.id) 41 | $farmhealthstatus = $health.health 42 | $farmname = $farm.data.name 43 | Write-PScriboMessage "RDS Farms Status Information." 44 | $inObj = [ordered] @{ 45 | "Farm Name" = $farmname; 46 | "Farm Health" = $farmhealthstatus; 47 | "RDS Hostname" = $rdsserver.name; 48 | "RDS Status" = $rdsserver.status; 49 | "RDS health" = $rdsserver.health; 50 | "RDS Available" = $rdsserver.available; 51 | "RDS Missing Apps" = $missingapps; 52 | "RDS Load Preference" = $rdsserver.LoadPreference; 53 | } 54 | 55 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 56 | } 57 | } 58 | 59 | $TableParams = @{ 60 | Name = "RDS Farms Health Information - $($HVEnvironment.toUpper())" 61 | List = $false 62 | ColumnWidths = 14, 8, 16, 8, 12, 10, 10, 12, 12 63 | } 64 | 65 | if ($Report.ShowTableCaptions) { 66 | $TableParams['Caption'] = "- $($TableParams.Name)" 67 | } 68 | 69 | $OutObj | Table @TableParams 70 | } 71 | } 72 | } 73 | } catch { 74 | Write-PScriboMessage -IsWarning $_.Exception.Message 75 | } 76 | } 77 | end {} 78 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZHCRemotePod.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZHCRemotePod { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module, Wouter Kursten - Health Check 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Remote Pod Health Check InfoLevel set at $($HealthCheck.RemotePod.RemotePod)." 27 | Write-PScriboMessage "Remote Pod Health information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($CloudPodListsLocal) { 33 | if ($HealthCheck.RemotePod.RemotePod) { 34 | Section -Style Heading3 "Remote Pod Health Information" { 35 | Paragraph "The following section details on the Remote Pod health information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($pod in $CloudPodListsLocal){ 39 | if($pod){ 40 | $endpoints = $hzServices.podhealth.podhealth_get($pod.id).data.endpointhealth 41 | $PodDetail = $hzServices.pod.pod_get($pod.id) 42 | $PodName = $PodDetail.DisplayName 43 | #$PodName = "Pod Name" 44 | if($endpoints){ 45 | foreach ($endpoint in $endpoints){ 46 | 47 | Write-PScriboMessage "Remote Pod Health Status Information." 48 | $inObj = [ordered] @{ 49 | "Status" = $endpoint.EndpointInfo | Select-Object -expandproperty Enabled; 50 | "Name" = $PodName; 51 | "Connection Servers" = $endpoint.EndpointInfo | Select-Object -expandproperty Name; 52 | "Description" = $endpoint | Select-Object -expandproperty State; 53 | } 54 | 55 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 56 | } 57 | } 58 | } 59 | $pod = $null 60 | } 61 | 62 | $TableParams = @{ 63 | Name = "Remote Pod Health Information - $($HVEnvironment.toUpper())" 64 | List = $false 65 | ColumnWidths = 10, 25, 25, 30 66 | } 67 | 68 | if ($Report.ShowTableCaptions) { 69 | $TableParams['Caption'] = "- $($TableParams.Name)" 70 | } 71 | $OutObj | Table @TableParams 72 | } 73 | } 74 | } 75 | } catch { 76 | Write-PScriboMessage -IsWarning $_.Exception.Message 77 | } 78 | } 79 | end {} 80 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZHCSAML2.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZHCSAML2 { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module, Wouter Kursten - Health Check 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "SAML Health Check InfoLevel set at $($HealthCheck.OtherComponents.SAML2)." 27 | Write-PScriboMessage "SAML Health information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($SAMLAuthenticatorhealthlist) { 33 | if ($HealthCheck.OtherComponents.SAML2) { 34 | Section -Style Heading3 "SAML Health Information" { 35 | Paragraph "The following section details on the SAML health information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($SAMLAuthenticatorhealth in $SAMLAuthenticatorhealthlist){ 39 | 40 | Write-PScriboMessage "SAML Health Status Information." 41 | $inObj = [ordered] @{ 42 | "Status" = $SAMLAuthenticatorHealthList.ConnectionServerData.Status[0]; 43 | "Authenticator Name" = $SAMLAuthenticatorhealth.data.label; 44 | "Metadata URL" = $SAMLAuthenticatorhealth.data.MetadataURL; 45 | "Details" = $SAMLAuthenticatorhealth.data.Description; 46 | "Admin URL" = $SAMLAuthenticatorhealth.data.AdministratorURL; 47 | "TrueSSO Trigger Mode" = $SAMLAuthenticatorhealth.data.CertificateSsoTriggerMode; 48 | } 49 | 50 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 51 | 52 | } 53 | 54 | $TableParams = @{ 55 | Name = "SAML Health Information - $($HVEnvironment.toUpper())" 56 | List = $false 57 | ColumnWidths = 10, 10, 25, 10, 25, 10 58 | } 59 | 60 | if ($Report.ShowTableCaptions) { 61 | $TableParams['Caption'] = "- $($TableParams.Name)" 62 | } 63 | $OutObj | Table @TableParams 64 | } 65 | } 66 | } 67 | } catch { 68 | Write-PScriboMessage -IsWarning $_.Exception.Message 69 | } 70 | } 71 | end {} 72 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZHCTrueSSO.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZHCTrueSSO { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module, Wouter Kursten - Health Check 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "TrueSSO Health Check InfoLevel set at $($HealthCheck.Components.TrueSSO)." 27 | Write-PScriboMessage "TrueSSO Health information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($CertificateSSOconnectorHealthlist) { 33 | if ($InfoLevel.settings.servers.ConnectionServers.TrueSSO -ge 1) { 34 | Section -Style Heading3 "TrueSSO Health Information" { 35 | Paragraph "The following section details on the TrueSSO information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($CertificateSSOconnectorHealth in $CertificateSSOconnectorHealthlist) { 39 | if ($CertificateSSOconnectorHealth) { 40 | 41 | Write-PScriboMessage "Discovered TrueSSO Information." 42 | $inObj = [ordered] @{ 43 | 'TrueSSO Name' = $CertificateSSOconnectorHealth.DisplayName 44 | 'TrueSSO Enabled' = $CertificateSSOconnectorHealth.Enabled 45 | 'TrueSSO State' = $CertificateSSOconnectorHealth.Data.OverallState 46 | 'Primary ES' = $CertificateSSOconnectorHealth.Data.PrimaryEnrollmentServerHealth.DnsName 47 | 'Primary ES State' = $CertificateSSOconnectorHealth.Data.PrimaryEnrollmentServerHealth.State 48 | 'Primary ES State Reason' = $CertificateSSOconnectorHealth.Data.PrimaryEnrollmentServerHealth.StateReasons 49 | 'Secondary Enrollment Server' = $CertificateSSOconnectorHealth.Data.SecondaryEnrollmentServerHealth.DnsName 50 | 'Secondary Enrollment Server State' = $CertificateSSOconnectorHealth.Data.SecondaryEnrollmentServerHealth.State 51 | 'Secondary Enrollment Server State Reason' = $CertificateSSOconnectorHealth.Data.SecondaryEnrollmentServerHealth.StateReasons 52 | } 53 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 54 | } 55 | } 56 | 57 | $TableParams = @{ 58 | Name = "TrueSSO Health Information - $($HVEnvironment.toUpper())" 59 | List = $false 60 | ColumnWidths = 15, 10, 10, 15, 10, 20, 10, 10, 10 61 | } 62 | 63 | if ($Report.ShowTableCaptions) { 64 | $TableParams['Caption'] = "- $($TableParams.Name)" 65 | } 66 | $OutObj | Table @TableParams 67 | } 68 | } 69 | } 70 | } catch { 71 | Write-PScriboMessage -IsWarning $_.Exception.Message 72 | } 73 | } 74 | end {} 75 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZHCvCenter.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZHCvCenter { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module, Wouter Kursten - Health Check 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "vCenter Health Check InfoLevel set at $($HealthCheck.vSphere.vCenter)." 27 | Write-PScriboMessage "vCenter Health information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($vCenterHealth) { 33 | if ($HealthCheck.vSphere.vcenter) { 34 | Section -Style Heading3 "vCenter Health Information" { 35 | Paragraph "The following section details on the vCenter health information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($VCHealth in $vCenterHealth){ 39 | $Name=$VCHealth.data.name 40 | $TrimmedName = ($Name -replace "https://", "").Split(":")[0].ToLower() 41 | $version=$VCHealth.data.version 42 | $build=$VCHealth.data.build 43 | $apiVersion=$VCHealth.data.apiVersion 44 | 45 | foreach ($Connectionserver in $VCHealth.connectionServerData){ 46 | $CertHealth = $Connectionserver.certificateHealth.valid 47 | if ($CertHealth -eq "True") { 48 | $CertHealthOUt = "Okay" 49 | } else { 50 | $CertHealthOUt = "Invalid" 51 | } 52 | Write-PScriboMessage "vCenter Health Status Information." 53 | $inObj = [ordered] @{ 54 | "Name" = $TrimmedName; 55 | "Version"=$version; 56 | "Build"=$build; 57 | "API Version"=$apiVersion; 58 | "Connection Server" = $Connectionserver.name; 59 | "Status" = $Connectionserver.Status; 60 | "Thumbprint Accepted" = $Connectionserver.thumbprintAccepted; 61 | "Certificate Health" = $CertHealth; 62 | } 63 | 64 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 65 | } 66 | } 67 | 68 | $TableParams = @{ 69 | Name = "vCenter Health Information - $($HVEnvironment.toUpper())" 70 | List = $false 71 | ColumnWidths = 20, 7, 15, 10, 12, 10, 13, 13 72 | } 73 | 74 | if ($Report.ShowTableCaptions) { 75 | $TableParams['Caption'] = "- $($TableParams.Name)" 76 | } 77 | $OutObj | Table @TableParams 78 | } 79 | } 80 | } 81 | } catch { 82 | Write-PScriboMessage -IsWarning $_.Exception.Message 83 | } 84 | } 85 | end {} 86 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZHomeSite.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZHomeSite { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Home Site Assignments InfoLevel set at $($InfoLevel.UsersAndGroups.HomeSiteAssignments)." 27 | Write-PScriboMessage "Collecting Home Site General Information." 28 | } 29 | 30 | process { 31 | if ($InfoLevel.UsersAndGroups.HomeSiteAssignments -ge 1) { 32 | try { 33 | if ($Homesites) { 34 | Section -Style Heading3 'Home Site' { 35 | Paragraph "The following section provide a summary of user and group home site configuration." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($HomeSite in $HomeSites) { 39 | try { 40 | # Clear Var 41 | $HomeSiteUserIDName = '' 42 | $HomeSiteUserIDDomain = '' 43 | $HomeSiteUserIDEmail = '' 44 | $HomeSiteUserIDGroup = '' 45 | $HomeSiteSiteIDName = '' 46 | $HomeSiteGlobalEntitlementIDName = '' 47 | $HomeSiteGlobalApplicationEntitlementIDName = '' 48 | 49 | # HomeSite User or Group ID 50 | if ($HomeSite.Base.UserOrGroup) { 51 | $HomeSiteUserID = $hzServices.ADUserOrGroup.ADUserOrGroup_Get($homesite.Base.UserOrGroup) 52 | $HomeSiteUserIDName = $HomeSiteUserID.Base.Name 53 | $HomeSiteUserIDDomain = $HomeSiteUserID.Base.Domain 54 | $HomeSiteUserIDEmail = $HomeSiteUserID.Base.Email 55 | $HomeSiteUserIDGroup = $HomeSiteUserID.Base.Group 56 | } 57 | 58 | # Home Site Site ID 59 | if ($HomeSite.Base.Site) { 60 | $HomeSiteSiteID = $hzServices.Site.Site_Get($HomeSite.Base.Site) 61 | $HomeSiteSiteIDName = $HomeSiteSiteID.base.DisplayName 62 | } 63 | 64 | # Home Site Global Entilement ID 65 | if ($HomeSite.Base.GlobalEntitlement) { 66 | $HomeSiteGlobalEntitlementID = $hzServices.GlobalEntitlement.GlobalEntitlement_Get($homesite.Base.GlobalEntitlement) 67 | $HomeSiteGlobalEntitlementIDName = $HomeSiteGlobalEntitlementID.base.DisplayName 68 | } 69 | 70 | # Home Site Global Application Entilement ID 71 | if ($HomeSite.Base.GlobalApplicationEntitlement) { 72 | $HomeSiteGlobalApplicationEntitlementID = $hzServices.GlobalApplicationEntitlement.GlobalApplicationEntitlement_Get($homesite.Base.GlobalApplicationEntitlement) 73 | $HomeSiteGlobalApplicationEntitlementIDName = $HomeSiteGlobalApplicationEntitlementID.base.DisplayName 74 | } 75 | $inObj = [ordered] @{ 76 | 'User or Group Name' = $HomeSiteUserIDName 77 | 'Domain' = $HomeSiteUserIDDomain 78 | 'Group' = $HomeSiteUserIDGroup 79 | 'Email' = $HomeSiteUserIDEmail 80 | 'Home Site' = $HomeSiteSiteIDName 81 | 'Global Entitlement' = $HomeSiteGlobalEntitlementIDName 82 | 'Global Application Entitlement' = $HomeSiteGlobalApplicationEntitlementIDName 83 | } 84 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 85 | } catch { 86 | Write-PScriboMessage -IsWarning $_.Exception.Message 87 | } 88 | } 89 | 90 | $TableParams = @{ 91 | Name = "Home Site General - $($HVEnvironment.toUpper())" 92 | List = $false 93 | ColumnWidths = 17, 10, 10, 18, 15, 15, 15 94 | } 95 | 96 | if ($Report.ShowTableCaptions) { 97 | $TableParams['Caption'] = "- $($TableParams.Name)" 98 | } 99 | $OutObj | Sort-Object -Property 'User or Group Name' | Table @TableParams 100 | } 101 | } 102 | } catch { 103 | Write-PScriboMessage -IsWarning $_.Exception.Message 104 | } 105 | } 106 | } 107 | end {} 108 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZInfrastructure.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZInfrastructure { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr, Chris Hildebrandt 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Collecting Infrastructure Summary information." 27 | } 28 | 29 | process { 30 | try { 31 | Section -Style NOTOCHeading4 "Executive Summary for $($HVEnvironment.toUpper())" { 32 | $OutObj = @() 33 | Write-PScriboMessage "Discovered Infrastructure Summary Information." 34 | $inObj = [ordered] @{ 35 | 'Number of Local Entitlements' = $EntitledUserOrGroupLocalMachines.Count 36 | 'Number of Global Entitlements' = $GlobalEntitlements.Count 37 | 'Number of Desktop Pools' = $Pools.Count 38 | 'Number of Application Pool' = $Apps.Count 39 | 'Number of Farms Pools' = $Farms.Count 40 | 'Number of vCenter Servers' = $vCenterServers.Count 41 | 'Number of ESXi Hosts' = $Esxhosts.HostData.Count 42 | 'Number of Datastores' = $Datastores.DatastoreData.Count 43 | 'Number of Active Directory Domains' = $ADDomains.Count 44 | 'Number of UAG Servers' = $GatewayServers.Count 45 | 'Number of Connection Servers' = $connectionservers.Count 46 | 'Number of Instant Clone Accounts' = $InstantCloneDomainAdmins.Count 47 | 'Number of RDS Hosts' = $RDSServers.Count 48 | 'Number of Administrators and Groups' = $Administrators.Count 49 | } 50 | 51 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 52 | 53 | $TableParams = @{ 54 | Name = "Executive Summary - $($HVEnvironment.toUpper())" 55 | List = $true 56 | ColumnWidths = 50, 50 57 | } 58 | 59 | if ($Report.ShowTableCaptions) { 60 | $TableParams['Caption'] = "- $($TableParams.Name)" 61 | } 62 | $OutObj | Table @TableParams 63 | } 64 | } catch { 65 | Write-PScriboMessage -IsWarning $_.Exception.Message 66 | } 67 | } 68 | end {} 69 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZInstantClone.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZInstantClone { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "InstantCloneDomainAccounts InfoLevel set at $($InfoLevel.Settings.InstantClone.InstantCloneDomainAccounts)." 27 | Write-PScriboMessage "Collecting Instant Clone Domain Accounts information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($InstantCloneDomainAdmins) { 33 | if ($InfoLevel.Settings.InstantClone.InstantCloneDomainAccounts -ge 1) { 34 | Section -Style Heading3 "Instant Clone Accounts" { 35 | Paragraph "The following section details the Instant Clone Accounts configuration for $($HVEnvironment.split('.')[0]) server." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($InstantCloneDomainAdmin in $InstantCloneDomainAdmins) { 39 | try { 40 | Write-PScriboMessage "Discovered Instant Clone Accounts Information." 41 | $inObj = [ordered] @{ 42 | 'User Name' = $InstantCloneDomainAdmin.Base.UserName 43 | 'Domain Name' = $InstantCloneDomainAdmin.NamesData.DnsName 44 | } 45 | 46 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 47 | } catch { 48 | Write-PScriboMessage -IsWarning $_.Exception.Message 49 | } 50 | } 51 | 52 | $TableParams = @{ 53 | Name = "Instant Clone Domain Accounts - $($HVEnvironment.split(".").toUpper()[0])" 54 | List = $false 55 | ColumnWidths = 50, 50 56 | } 57 | 58 | if ($Report.ShowTableCaptions) { 59 | $TableParams['Caption'] = "- $($TableParams.Name)" 60 | } 61 | $OutObj | Sort-Object -Property 'User Name' | Table @TableParams 62 | } 63 | } 64 | } 65 | } catch { 66 | Write-PScriboMessage -IsWarning $_.Exception.Message 67 | } 68 | } 69 | end {} 70 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZLicense.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZLicense { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "ProductLicensingandUsage InfoLevel set at $($InfoLevel.Settings.ProductLicensing.ProductLicensingandUsage)." 27 | Write-PScriboMessage "Collecting Product Licensing information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($ProductLicenseingInfo) { 33 | if ($InfoLevel.Settings.ProductLicensing.ProductLicensingandUsage -ge 1) { 34 | Section -Style Heading2 "Product Licensing and Usage" { 35 | Paragraph "The following section details the product license and usage information for $($HVEnvironment.toUpper()) server." 36 | BlankLine 37 | 38 | Section -Style Heading3 "Licensing" { 39 | $OutObj = @() 40 | foreach ($ProductLic in $ProductLicenseingInfo) { 41 | try { 42 | Write-PScriboMessage "Discovered Product Licensing Information." 43 | 44 | # If $ProductLic.ExpirationTime is null, then the license is perpetual 45 | $ProductLicExpirationTime = "" 46 | if ($null -eq $ProductLic.ExpirationTime) { 47 | $ProductLicExpirationTime = "Perpetual" 48 | } else { 49 | $ProductLicExpirationTime = $ProductLic.ExpirationTime.ToShortDateString() 50 | } 51 | 52 | $inObj = [ordered] @{ 53 | 'Is Licensed' = $ProductLic.Licensed 54 | 'License Key' = $ProductLic.LicenseKey 55 | 'License Expiration' = $ProductLicExpirationTime 56 | 'Composer enabled' = $ProductLic.ViewComposerEnabled 57 | 'Desktop Launching enabled' = $ProductLic.DesktopLaunchingEnabled 58 | 'Application Launching enabled' = $ProductLic.ApplicationLaunchingEnabled 59 | 'Instant Clone enabled' = $ProductLic.InstantCloneEnabled 60 | 'Helpdesk enabled' = $ProductLic.HelpDeskEnabled 61 | 'Collaboration enabled' = $ProductLic.CollaborationEnabled 62 | 'License Edition' = $ProductLic.LicenseEdition 63 | 'License Usage Model' = $ProductLic.UsageModel 64 | 'License Mode' = $ProductLic.LicenseMode 65 | 'Grace Period Days' = $ProductLic.GracePeriodDays 66 | 'Subscription Slice Expiry' = $ProductLic.SubscriptionSliceExpiry 67 | 'License Health' = $ProductLic.LicenseHealth 68 | } 69 | 70 | $OutObj = [pscustomobject](ConvertTo-HashToYN $inObj) 71 | } Catch { 72 | Write-PScriboMessage -IsWarning $_.Exception.Message 73 | } 74 | } 75 | $TableParams = @{ 76 | Name = "Licensing - $($HVEnvironment.toUpper())" 77 | List = $true 78 | ColumnWidths = 50, 50 79 | } 80 | 81 | if ($Report.ShowTableCaptions) { 82 | $TableParams['Caption'] = "- $($TableParams.Name)" 83 | } 84 | $OutObj | Table @TableParams 85 | } 86 | try { 87 | $UsageStatisticsInfo = try { $hzServices.UsageStatistics.UsageStatistics_GetLicensingCounters() } catch { Write-PScriboMessage -IsWarning $_.Exception.Message } 88 | if ($UsageStatisticsInfo) { 89 | if ($InfoLevel.Settings.ProductLicensing.ProductLicensingandUsage -ge 2) { 90 | Section -Style Heading3 "Usage" { 91 | $OutObj = @() 92 | foreach ($ProductUsage in $UsageStatisticsInfo.HighestUsage.PSObject.Properties.Name) { 93 | try { 94 | Write-PScriboMessage "Discovered Product Licensing Usage Information." 95 | $inObj = [ordered] @{ 96 | 'Name' = ($ProductUsage -creplace '([A-Z\W_]|\d+)(? 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Machine InfoLevel set at $($InfoLevel.Inventory.Machines)." 27 | Write-PScriboMessage "Collecting Machine information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($Machines) { 33 | if ($InfoLevel.Inventory.Machines -ge 1) { 34 | Section -Style Heading3 "Machines" { 35 | Paragraph "The following section details on all of the machine information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | Write-PScriboMessage "Working on Machines Information for $($HVEnvironment.toUpper())." 38 | Section -Style Heading4 "vCenter Machine Summary" { 39 | $OutObj = @() 40 | foreach ($Machine in $Machines) { 41 | $inObj = [ordered] @{ 42 | 'Machine Name' = $Machine.Base.Name 43 | 'Agent Version' = $Machine.Base.AgentVersion 44 | 'User' = $Machine.Base.User 45 | 'Host' = $Machine.ManagedMachineData.VirtualCenterData.Hostname 46 | 'Data Store' = $Machine.ManagedMachineData.VirtualCenterData.VirtualDisks.DatastorePath 47 | 'Basic State' = $Machine.Base.BasicState 48 | } 49 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 50 | } 51 | $TableParams = @{ 52 | Name = "vCenter Machine Summary - $($HVEnvironment.toUpper())" 53 | List = $false 54 | ColumnWidths = 15, 10, 20, 25, 15, 15 55 | } 56 | if ($Report.ShowTableCaptions) { 57 | $TableParams['Caption'] = "- $($TableParams.Name)" 58 | } 59 | $OutObj | Table @TableParams 60 | } 61 | } 62 | } 63 | } 64 | } catch { 65 | Write-PScriboMessage -IsWarning $_.Exception.Message 66 | } 67 | } 68 | end {} 69 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZRegisteredMachine.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZRegisteredMachine { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "RegisteredMachines InfoLevel set at $($InfoLevel.Settings.RegisteredMachines.RDSHosts)." 27 | Write-PScriboMessage "Collecting Registered Machines information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($RDSServers) { 33 | if ($InfoLevel.Settings.RegisteredMachines.RDSHosts -ge 1) { 34 | Section -Style Heading2 "Registered Machines" { 35 | Paragraph "The following section provides information of Registered Machines for $($HVEnvironment.toUpper()) server." 36 | BlankLine 37 | Section -Style Heading3 'RDS Hosts' { 38 | Paragraph "The following section details the RDS Hosts configuration for $($HVEnvironment.toUpper()) server." 39 | BlankLine 40 | $OutObj = @() 41 | foreach ($RDSServer in $RDSServers) { 42 | Write-PScriboMessage "Discovered RDS Hosts Information." 43 | $inObj = [ordered] @{ 44 | 'Name' = $RDSServer.base.name 45 | 'Farm Name' = $RDSServer.SummaryData.FarmName 46 | 'Status' = $RDSServer.runtimedata.Status 47 | } 48 | 49 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 50 | } 51 | 52 | if ($HealthCheck.RegisteredMachines.Status) { 53 | $OutObj | Where-Object { $_.'Status' -ne 'AVAILABLE' } | Set-Style -Style Warning 54 | } 55 | 56 | $TableParams = @{ 57 | Name = "RDS Hosts - $($HVEnvironment.toUpper())" 58 | List = $false 59 | ColumnWidths = 34, 33, 33 60 | } 61 | 62 | if ($Report.ShowTableCaptions) { 63 | $TableParams['Caption'] = "- $($TableParams.Name)" 64 | } 65 | $OutObj | Table @TableParams 66 | try { 67 | if ($InfoLevel.Settings.RegisteredMachines.RDSHosts -ge 2) { 68 | Section -Style Heading4 'RDS Hosts Details' { 69 | foreach ($RDSServer in $RDSServers) { 70 | Write-PScriboMessage "Discovered RDS Host $($RDSServer.base.name) Information." 71 | $OutObj = @() 72 | Section -ExcludeFromTOC -Style NOTOCHeading6 $RDSServer.Base.Name { 73 | $inObj = [ordered] @{ 74 | 'Name' = $RDSServer.base.name 75 | 'Description' = $RDSServer.base.Description 76 | 'Farm Name' = $RDSServer.SummaryData.FarmName 77 | 'Desktop Pool Name' = $RDSServer.SummaryData.DesktopName 78 | 'Farm Type' = $RDSServer.SummaryData.FarmType 79 | 'Access Group' = $RDSServerAccessgroup 80 | 'Message Security Mode' = $RDSServer.MessageSecurityData.MessageSecurityMode 81 | 'Message Security Enhanced Mode Supported' = $RDSServer.MessageSecurityData.MessageSecurityEnhancedModeSupported 82 | 'Operating System' = $RDSServer.agentdata.OperatingSystem 83 | 'Agent Version' = $RDSServer.agentdata.AgentVersion 84 | 'Agent Build Number' = $RDSServer.agentdata.AgentBuildNumber 85 | 'Remote Experience Agent Version' = $RDSServer.agentdata.RemoteExperienceAgentVersion 86 | 'Remote Experience Agent Build Number' = $RDSServer.agentdata.RemoteExperienceAgentBuildNumber 87 | 'Max Sessions Type' = $RDSServer.settings.SessionSettings.MaxSessionsType 88 | 'Max Sessions Set By Admin' = $RDSServer.settings.SessionSettings.MaxSessionsSetByAdmin 89 | 'Agent Max Sessions Type' = $RDSServer.settings.AgentMaxSessionsData.MaxSessionsType 90 | 'Agent Max Sessions Set By Admin' = $RDSServer.settings.AgentMaxSessionsData.MaxSessionsSeenByAgent 91 | 'Enabled' = $RDSServer.settings.enabled 92 | 'Status' = $RDSServer.runtimedata.Status 93 | } 94 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 95 | 96 | $TableParams = @{ 97 | Name = "RDS Host - $($RDSServer.base.name)" 98 | List = $true 99 | ColumnWidths = 50, 50 100 | } 101 | 102 | if ($Report.ShowTableCaptions) { 103 | $TableParams['Caption'] = "- $($TableParams.Name)" 104 | } 105 | $OutObj | Table @TableParams 106 | } 107 | } 108 | } 109 | } 110 | } catch { 111 | Write-PScriboMessage -IsWarning $_.Exception.Message 112 | } 113 | 114 | if ($RegisteredPhysicalMachines) { 115 | Section -Style Heading3 'Others' { 116 | Paragraph "The following section details the RDS Hosts configuration for $($HVEnvironment.toUpper()) server." 117 | BlankLine 118 | $OutObj = @() 119 | foreach ($RegisteredPhysicalMachine in $RegisteredPhysicalMachines) { 120 | Write-PScriboMessage "Other Registerd Machines" 121 | $inObj = [ordered] @{ 122 | 'Name' = $RegisteredPhysicalMachines.MachineBase.name 123 | 'DNS Name' = $RegisteredPhysicalMachines.MachineBase.DnsName 124 | 'Description' = $RegisteredPhysicalMachines.MachineBase.Description 125 | 'OperatingSystem' = $RegisteredPhysicalMachines.MachineBase.Description 126 | } 127 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 128 | } 129 | if ($HealthCheck.RegisteredMachines.Status) { 130 | $OutObj | Where-Object { $_.'Status' -ne 'AVAILABLE' } | Set-Style -Style Warning 131 | } 132 | $TableParams = @{ 133 | Name = "Other Registered Machines - $($HVEnvironment.toUpper())" 134 | List = $false 135 | ColumnWidths = 20, 20, 30, 30 136 | } 137 | if ($Report.ShowTableCaptions) { 138 | $TableParams['Caption'] = "- $($TableParams.Name)" 139 | } 140 | } 141 | } 142 | } 143 | } 144 | } 145 | } 146 | } catch { 147 | Write-PScriboMessage -IsWarning $_.Exception.Message 148 | } 149 | } 150 | end {} 151 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZRolePermission.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZRolePermission { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Role Permissions InfoLevel set at $($InfoLevel.Settings.Administrators.RolePermissions)." 27 | Write-PScriboMessage "Collecting Role Permissions information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($Permissions) { 33 | if ($InfoLevel.Settings.Administrators.RolePermissions -ge 1) { 34 | Section -Style Heading3 "Role Permissions" { 35 | Paragraph "The following section details the Role Permissions information for $($HVEnvironment.toUpper()) server." 36 | BlankLine 37 | $OutObj = @() 38 | 39 | $FilteredPermissions = '' 40 | $FilteredPermissions = $Permissions | Where-Object { $null -eq $_.base.GlobalAccessGroup } 41 | 42 | foreach ($Permission in $FilteredPermissions) { 43 | Write-PScriboMessage "Discovered Role Permissions Information." 44 | $AdministratorIDNameResults = '' 45 | # Find Administrator ID Name 46 | $AdministratorIDName = '' 47 | $PermissionGroups = $Permission.base.UserOrGroup.id 48 | foreach ($PermissionGroup in $PermissionGroups) { 49 | foreach ($Administrator in $Administrators) { 50 | if ($Administrator.Id.id -eq $PermissionGroup) { 51 | $AdministratorIDName = $Administrator.base.name 52 | break 53 | } 54 | } 55 | if ($PermissionGroups.count -gt 1) { 56 | $AdministratorIDNameResults += "$AdministratorIDName, " 57 | $AdministratorIDName = $AdministratorIDNameResults.TrimEnd(', ') 58 | } 59 | } 60 | Switch ($AdministratorIDName) { 61 | '' { $AdministratorIDName = 'N/A' } 62 | ' ' { $AdministratorIDName = 'N/A' } 63 | } 64 | 65 | # Mach Permission Role ID with Role ID 66 | # Find Role ID Name 67 | $RoleIDName = '' 68 | $PermissionGroups = $Permission.base.Role.id 69 | foreach ($PermissionGroup in $PermissionGroups) { 70 | 71 | foreach ($Role in $Roles) { 72 | if ($Role.Id.id -eq $PermissionGroup) { 73 | $RoleIDName = $Role.base.name 74 | break 75 | } 76 | 77 | } 78 | if ($PermissionGroups.count -gt 1) { 79 | $RoleIDNameResults += "$RoleIDName, " 80 | $RoleIDName = $RoleIDNameResults.TrimEnd(', ') 81 | $RoleIDName = [string](($RoleIDName.split(', ') | Select-Object -Unique) -join ', ') 82 | } 83 | } 84 | 85 | # Find AccessGroup ID Name 86 | $AccessGroupIDNameResults = '' 87 | $AccessGroupIDName = '' 88 | $PermissionGroups = $Permission.base.AccessGroup.id 89 | foreach ($PermissionGroup in $PermissionGroups) { 90 | foreach ($AccessGroup in $AccessGroups) { 91 | if ($AccessGroup.Id.id -eq $PermissionGroup) { 92 | $AccessGroupIDName = "/$($AccessGroup.base.name)" 93 | } elseif ($AccessGroup.Children.id.id -eq $PermissionGroup) { 94 | $AccessGroupIDName = "/Root/$(($AccessGroup.Children | Where-Object {$_.id.id -eq $PermissionGroup}).Base.Name)" 95 | } else { 96 | $AccessGroupIDName = "Federation Access Group" 97 | } 98 | } 99 | if ($PermissionGroups.count -gt 1) { 100 | $AccessGroupIDNameResults += "$AccessGroupIDName, " 101 | $AccessGroupIDName = $AccessGroupIDNameResults.TrimEnd(', ') 102 | } 103 | } 104 | 105 | $inObj = [ordered] @{ 106 | 'User or Group Name' = $AdministratorIDName 107 | 'Role' = $RoleIDName 108 | 'Access Group' = $AccessGroupIDName 109 | } 110 | 111 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 112 | } 113 | 114 | $TableParams = @{ 115 | Name = "Role Permissions - $($HVEnvironment.toUpper())" 116 | List = $false 117 | ColumnWidths = 33, 33, 34 118 | } 119 | 120 | if ($Report.ShowTableCaptions) { 121 | $TableParams['Caption'] = "- $($TableParams.Name)" 122 | } 123 | $OutObj | Sort-Object -Property 'User or Group Name' | Table @TableParams 124 | } 125 | } 126 | } 127 | } catch { 128 | Write-PScriboMessage -IsWarning $_.Exception.Message 129 | } 130 | } 131 | end {} 132 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZRolePrivilege.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZRolePrivilege { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Role Provilege InfoLevel set at $($InfoLevel.Settings.Administrators.RolePrivileges)." 27 | Write-PScriboMessage "Collecting Role Provilege information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($Roles) { 33 | if ($InfoLevel.Settings.Administrators.RolePrivileges -ge 1) { 34 | Section -Style Heading3 "Role Privileges" { 35 | Paragraph "The following section details the Role Privileges information for $($HVEnvironment.toUpper()) server." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($Role in $Roles) { 39 | Write-PScriboMessage "Discovered Role Provilege Information." 40 | $inObj = [ordered] @{ 41 | 'Name' = $Role.base.Name 42 | 'Description' = $Role.base.Description 43 | } 44 | 45 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 46 | } 47 | 48 | $TableParams = @{ 49 | Name = "Role Privileges - $($HVEnvironment.toUpper())" 50 | List = $false 51 | ColumnWidths = 50, 50 52 | } 53 | 54 | if ($Report.ShowTableCaptions) { 55 | $TableParams['Caption'] = "- $($TableParams.Name)" 56 | } 57 | $OutObj | Sort-Object -Property 'Name' | Table @TableParams 58 | } 59 | if ($InfoLevel.Settings.Administrators.RolePrivileges -ge 2) { 60 | Section -Style Heading4 "Role Privileges Details" { 61 | Paragraph "The following section details the Role Privilege details for information for $($HVEnvironment.toUpper()) server." 62 | BlankLine 63 | $OutObj = @() 64 | foreach ($Role in $Roles) { 65 | Write-PScriboMessage "Discovered Role Provilege Detailed Information for $($HVEnvironment.toUpper()) server." 66 | $inObj = [ordered] @{ 67 | 'Name' = $Role.base.Name 68 | 'Description' = [string]::join("`n", $($Role.base.Privileges)) 69 | } 70 | 71 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 72 | } 73 | 74 | $TableParams = @{ 75 | Name = "Role Privileges Details - $($Role.base.Name)" 76 | List = $false 77 | ColumnWidths = 50, 50 78 | } 79 | 80 | if ($Report.ShowTableCaptions) { 81 | $TableParams['Caption'] = "- $($TableParams.Name)" 82 | } 83 | $OutObj | Sort-Object -Property 'Name' | Table @TableParams 84 | } 85 | } 86 | 87 | 88 | } 89 | } 90 | } catch { 91 | Write-PScriboMessage -IsWarning $_.Exception.Message 92 | } 93 | } 94 | end {} 95 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZSite.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZSite { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "Site InfoLevel set at $($InfoLevel.Settings.Sites.Sites)." 27 | Write-PScriboMessage "Collecting Cloud Pod Site information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($CloudPodSites) { 33 | if ($InfoLevel.Settings.Sites.Sites -ge 1) { 34 | Section -Style Heading2 "Site" { 35 | Paragraph "The following section details on the Cloud Pod Site information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($CloudPodSite in $CloudPodSites) { 39 | 40 | # Find CloudPod Info 41 | foreach ($CloudPodList in $CloudPodLists) { 42 | if ($CloudPodList.Id.id -eq $CloudPodSite.pods.id) { 43 | $CloudPodDisplayName = $CloudPodList.DisplayName 44 | break 45 | } # if($AccessGroup.Id.id -eq $RDSServers.base.accessgroup.id) 46 | } # Close out foreach($AccessGroup in $AccessGroups) 47 | 48 | 49 | Write-PScriboMessage "Discovered Site Information." 50 | $inObj = [ordered] @{ 51 | 'Cloud Pod Sites Name' = $CloudPodSite.base.DisplayName 52 | 'Cloud Pod Sites Description' = $CloudPodSite.base.Description 53 | 'Cloud Pod Site Pod Name' = $CloudPodDisplayName 54 | } 55 | 56 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 57 | } 58 | 59 | $TableParams = @{ 60 | Name = "Site - $($HVEnvironment.toUpper())" 61 | List = $true 62 | ColumnWidths = 50, 50 63 | } 64 | 65 | if ($Report.ShowTableCaptions) { 66 | #$TableParams['Caption'] = "- $($TableParams.Name)" 67 | } 68 | $OutObj | Table @TableParams 69 | } 70 | 71 | 72 | } 73 | } 74 | } catch { 75 | Write-PScriboMessage -IsWarning $_.Exception.Message 76 | } 77 | } 78 | end {} 79 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZTSSO.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZTSSO { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "TrueSSO InfoLevel set at $($InfoLevel.Settings.Servers.ConnectionServers.TrueSSO)." 27 | Write-PScriboMessage "TrueSSO information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($CertificateSSOconnectorHealthlist) { 33 | if ($InfoLevel.settings.servers.ConnectionServers.TrueSSO -ge 1) { 34 | Section -Style Heading3 "TrueSSO Information" { 35 | Paragraph "The following section details on the TrueSSO information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($CertificateSSOconnectorHealth in $CertificateSSOconnectorHealthlist) { 39 | if ($CertificateSSOconnectorHealth) { 40 | 41 | Write-PScriboMessage "Discovered TrueSSO Information." 42 | $inObj = [ordered] @{ 43 | 'TrueSSO Name' = $CertificateSSOconnectorHealth.DisplayName 44 | 'TrueSSO Enabled' = $CertificateSSOconnectorHealth.Enabled 45 | 'TrueSSO State' = $CertificateSSOconnectorHealth.Data.OverallState 46 | 'Primary Enrollment Server' = $CertificateSSOconnectorHealth.Data.PrimaryEnrollmentServerHealth.DnsName 47 | 'Primary Enrollment Server State' = $CertificateSSOconnectorHealth.Data.PrimaryEnrollmentServerHealth.State 48 | 'Primary Enrollment Server State Reason' = $CertificateSSOconnectorHealth.Data.PrimaryEnrollmentServerHealth.StateReasons 49 | 'Secondary Enrollment Server' = $CertificateSSOconnectorHealth.Data.SecondaryEnrollmentServerHealth.DnsName 50 | 'Secondary Enrollment Server State' = $CertificateSSOconnectorHealth.Data.SecondaryEnrollmentServerHealth.State 51 | 'Secondary Enrollment Server State Reason' = $CertificateSSOconnectorHealth.Data.SecondaryEnrollmentServerHealth.StateReasons 52 | 'Template Name' = $CertificateSSOconnectorHealth.Data.TemplateHealth.name 53 | 'Template State' = $CertificateSSOconnectorHealth.Data.TemplateHealth.State 54 | 'Template Primary Enrollment Server State Reason' = $CertificateSSOconnectorHealth.Data.TemplateHealth.PrimaryEnrollmentServerStateReasons 55 | 'Template Secondary Enrollment Server State Reason' = $CertificateSSOconnectorHealth.Data.TemplateHealth.SecondaryEnrollmentServerStateReasons 56 | 'Certificate Server Name' = $CertificateSSOconnectorHealth.Data.CertificateServerHealths.Name 57 | 'Certificate Server State' = $CertificateSSOconnectorHealth.Data.CertificateServerHealths.State 58 | 'Certificate Server Primary Enrollment Server State Reason' = $CertificateSSOconnectorHealth.Data.CertificateServerHealths.PrimaryEnrollmentServerStateReasons 59 | 'Certificate Server Secondary Enrollment Server State Reason' = $CertificateSSOconnectorHealth.Data.CertificateServerHealths.SecondaryEnrollmentServerStateReasons 60 | } 61 | 62 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 63 | } 64 | if (-not $CertificateSSOconnectorHealth.Data.SecondaryEnrollmentServerHealth.DnsName) { 65 | $inObj.Remove('Secondary Enrollment Server') 66 | $inObj.Remove('Secondary Enrollment Server State') 67 | $inObj.Remove('Secondary Enrollment Server State Reason') 68 | $inObj.Remove('Template Secondary Enrollment Server State Reason') 69 | $inObj.Remove('Certificate Server Secondary Enrollment Server State Reason') 70 | } 71 | } 72 | 73 | $TableParams = @{ 74 | Name = "TrueSSO Information - $($HVEnvironment.toUpper())" 75 | List = $true 76 | ColumnWidths = 50, 50 77 | } 78 | 79 | if ($Report.ShowTableCaptions) { 80 | $TableParams['Caption'] = "- $($TableParams.Name)" 81 | } 82 | $OutObj | Table @TableParams 83 | } 84 | } 85 | } 86 | } catch { 87 | Write-PScriboMessage -IsWarning $_.Exception.Message 88 | } 89 | } 90 | end {} 91 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZUAG.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZUAG { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "SecurityServers InfoLevel set at $($InfoLevel.Settings.Servers.vCenterServers.ADDomains)." 27 | Write-PScriboMessage "Collecting Gateway Servers information." 28 | } 29 | 30 | process { 31 | try { 32 | if ($GatewayServers) { 33 | if ($InfoLevel.Settings.Servers.UAG.UAGServers -ge 1) { 34 | Section -Style Heading3 "Gateway Servers" { 35 | Paragraph "The following section details the Gateway Servers information for $($HVEnvironment.toUpper())." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($GatewayServer in $GatewayServers.GeneralData) { 39 | try { 40 | Write-PScriboMessage "Discovered UAG Information $($GatewayServer.Name)." 41 | Switch ($GatewayServer.Type) { 42 | 'AP' { $GatewayType = 'UAG' } 43 | } 44 | $inObj = [ordered] @{ 45 | 'Name' = $GatewayServer.Name 46 | 'IP' = $GatewayServer.Address 47 | 'Version' = $GatewayServer.Version 48 | 'Type' = $GatewayType 49 | 'Zone Internal' = $GatewayServer.GatewayZoneInternal 50 | } 51 | 52 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 53 | } catch { 54 | Write-PScriboMessage -IsWarning $_.Exception.Message 55 | } 56 | } 57 | 58 | $TableParams = @{ 59 | Name = "Gateway Servers - $($HVEnvironment.toUpper())" 60 | List = $false 61 | ColumnWidths = 35, 20, 15, 15, 15 62 | } 63 | 64 | if ($Report.ShowTableCaptions) { 65 | $TableParams['Caption'] = "- $($TableParams.Name)" 66 | } 67 | $OutObj | Sort-Object -Property 'Name' | Table @TableParams 68 | } 69 | } 70 | } 71 | } catch { 72 | Write-PScriboMessage -IsWarning $_.Exception.Message 73 | } 74 | } 75 | end {} 76 | } -------------------------------------------------------------------------------- /Src/Private/Get-AbrHRZUnauthenticatedACL.ps1: -------------------------------------------------------------------------------- 1 | function Get-AbrHRZUnauthenticatedACL { 2 | <# 3 | .SYNOPSIS 4 | PowerShell script which documents the configuration of VMware Horizon in Word/HTML/XML/Text formats 5 | .DESCRIPTION 6 | Documents the configuration of VMware Horizon in Word/HTML/XML/Text formats using PScribo. 7 | .NOTES 8 | Version: 1.1.5 9 | Author: Chris Hildebrandt, Karl Newick 10 | Twitter: @childebrandt42, @karlnewick 11 | Editor: Jonathan Colon, @jcolonfzenpr 12 | Twitter: @asbuiltreport 13 | Github: AsBuiltReport 14 | Credits: Iain Brighton (@iainbrighton) - PScribo module 15 | 16 | 17 | .LINK 18 | https://github.com/AsBuiltReport/AsBuiltReport.VMware.Horizon 19 | #> 20 | 21 | [CmdletBinding()] 22 | param ( 23 | ) 24 | 25 | begin { 26 | Write-PScriboMessage "UnauthenticatedAccess InfoLevel set at $($InfoLevel.UsersAndGroups.UnauthenticatedAccess)." 27 | Write-PScriboMessage "Collecting Unauthenticated Access Information." 28 | } 29 | 30 | process { 31 | if ($InfoLevel.UsersAndGroups.UnauthenticatedAccess -ge 1) { 32 | try { 33 | if ($unauthenticatedAccessList) { 34 | Section -Style Heading3 "Unauthenticated Access" { 35 | Paragraph "The following section provide a summary of user and group unauthenticated access configuration." 36 | BlankLine 37 | $OutObj = @() 38 | foreach ($unauthenticatedAccess in $unauthenticatedAccessList) { 39 | try { 40 | # User Info 41 | try { 42 | $unauthenticatedAccessUserIDName = '' 43 | if ($unauthenticatedAccess.userdata.UserId) { 44 | $unauthenticatedAccessUserID = $hzServices.ADUserOrGroup.ADUserOrGroup_Get($unauthenticatedAccess.userdata.UserId) 45 | $unauthenticatedAccessUserIDName = $unauthenticatedAccessUserID.Base.DisplayName 46 | } 47 | } catch { 48 | Write-PScriboMessage -IsWarning $_.Exception.Message 49 | } 50 | # Pod Info 51 | try { 52 | $unauthenticatedAccessPodListName = '' 53 | if ($unauthenticatedAccess.SourcePods) { 54 | $unauthenticatedAccessPodList = $CloudPodLists | Where-Object { $_.id.id -eq $unauthenticatedAccess.SourcePods.Id } 55 | $unauthenticatedAccessPodListName = $unauthenticatedAccessPodList.DisplayName 56 | } 57 | } catch { 58 | Write-PScriboMessage -IsWarning $_.Exception.Message 59 | } 60 | 61 | $inObj = [ordered] @{ 62 | 'Login Name' = $unauthenticatedAccess.userdata.LoginName 63 | 'User ID' = $unauthenticatedAccessUserIDName 64 | 'Description' = $unauthenticatedAccess.userdata.Description 65 | 'Hybrid Logon' = $unauthenticatedAccess.userdata.HybridLogonConfig 66 | 'Pod Name' = $unauthenticatedAccessPodListName 67 | } 68 | $OutObj += [pscustomobject](ConvertTo-HashToYN $inObj) 69 | } catch { 70 | Write-PScriboMessage -IsWarning $_.Exception.Message 71 | } 72 | } 73 | 74 | $TableParams = @{ 75 | Name = "Unauthenticated Access - $($HVEnvironment.toUpper())" 76 | List = $false 77 | ColumnWidths = 20, 20, 20, 20, 20 78 | } 79 | 80 | if ($Report.ShowTableCaptions) { 81 | $TableParams['Caption'] = "- $($TableParams.Name)" 82 | } 83 | $OutObj | Sort-Object -Property 'Login Name' | Table @TableParams 84 | } 85 | } 86 | } catch { 87 | Write-PScriboMessage -IsWarning $_.Exception.Message 88 | } 89 | } 90 | } 91 | end {} 92 | } -------------------------------------------------------------------------------- /Src/Private/Get-RequiredModule.ps1: -------------------------------------------------------------------------------- 1 | function Get-RequiredModule { 2 | <# 3 | .SYNOPSIS 4 | Function to check if the required version of VMware PowerCLI is installed 5 | .DESCRIPTION 6 | Function to check if the required version of VMware PowerCLI is installed 7 | .NOTES 8 | Version: 0.1.1 9 | Author: Tim Carman 10 | Twitter: @tpcarman 11 | Github: tpcarman 12 | .PARAMETER Name 13 | The name of the required PowerShell module 14 | .PARAMETER Version 15 | The version of the required PowerShell module 16 | #> 17 | [CmdletBinding()] 18 | Param ( 19 | [CmdletBinding()] 20 | [Parameter(Mandatory = $true, ValueFromPipeline = $false)] 21 | [ValidateNotNullOrEmpty()] 22 | [String]$Name, 23 | 24 | [CmdletBinding()] 25 | [Parameter(Mandatory = $true, ValueFromPipeline = $false)] 26 | [ValidateNotNullOrEmpty()] 27 | [String]$Version 28 | ) 29 | 30 | begin {} 31 | 32 | process { 33 | # Convert required version to a [Version] object 34 | $RequiredVersion = [Version]$Version 35 | 36 | # Find the latest installed version of the module 37 | $InstalledModule = Get-Module -ListAvailable -Name $Name | 38 | Sort-Object -Property Version -Descending | 39 | Select-Object -First 1 40 | 41 | if ($null -eq $InstalledModule) { 42 | throw "VMware PowerCLI $Version or higher is required. Run 'Install-Module -Name $Name -MinimumVersion $Version -Force' to install the required modules." 43 | } 44 | 45 | # Convert installed version to a [Version] object 46 | $InstalledVersion = [Version]$InstalledModule.Version 47 | 48 | Write-PScriboMessage -Plugin "Module" -IsWarning "$($InstalledModule.Name) $InstalledVersion is currently installed." 49 | 50 | if ($InstalledVersion -lt $RequiredVersion) { 51 | throw "VMware PowerCLI $Version or higher is required. Run 'Update-Module -Name $Name -MinimumVersion $Version -Force' to update the required modules." 52 | } 53 | } 54 | 55 | end {} 56 | } -------------------------------------------------------------------------------- /Src/Private/SharedUtilsFunctions.ps1: -------------------------------------------------------------------------------- 1 | function ConvertTo-TextYN { 2 | <# 3 | .SYNOPSIS 4 | Used by As Built Report to convert true or false automatically to Yes or No. 5 | .DESCRIPTION 6 | 7 | .NOTES 8 | Version: 0.3.0 9 | Author: LEE DAILEY 10 | 11 | .EXAMPLE 12 | 13 | .LINK 14 | 15 | #> 16 | [CmdletBinding()] 17 | [OutputType([String])] 18 | Param ( 19 | [Parameter ( 20 | Position = 0, 21 | Mandatory)] 22 | [AllowEmptyString()] 23 | [string] $TEXT 24 | ) 25 | 26 | switch ($TEXT) { 27 | "" { "--"; break } 28 | " " { "--"; break } 29 | $Null { "--"; break } 30 | "True" { "Yes"; break } 31 | "False" { "No"; break } 32 | default { $TEXT } 33 | } 34 | } # end 35 | function Get-UnixDate ($UnixDate) { 36 | <# 37 | .SYNOPSIS 38 | Used by As Built Report to convert Date to a more nice format. 39 | .DESCRIPTION 40 | 41 | .NOTES 42 | Version: 0.2.0 43 | Author: LEE DAILEY 44 | 45 | .EXAMPLE 46 | 47 | .LINK 48 | 49 | #> 50 | [timezone]::CurrentTimeZone.ToLocalTime(([datetime]'1/1/1970').AddSeconds($UnixDate)) 51 | } # end 52 | function ConvertTo-EmptyToFiller { 53 | <# 54 | .SYNOPSIS 55 | Used by As Built Report to convert empty columns to "-". 56 | .DESCRIPTION 57 | 58 | .NOTES 59 | Version: 0.5.0 60 | Author: Jonathan Colon 61 | 62 | .EXAMPLE 63 | 64 | .LINK 65 | 66 | #> 67 | [CmdletBinding()] 68 | [OutputType([String])] 69 | Param ( 70 | [Parameter ( 71 | Position = 0, 72 | Mandatory)] 73 | [AllowEmptyString()] 74 | [string] 75 | $TEXT 76 | ) 77 | 78 | switch ($TEXT) { 79 | "" { "-"; break } 80 | $Null { "-"; break } 81 | "True" { "Yes"; break } 82 | "False" { "No"; break } 83 | default { $TEXT } 84 | } 85 | } # end 86 | 87 | function ConvertTo-VIobject { 88 | <# 89 | .SYNOPSIS 90 | Used by As Built Report to convert object to VIObject. 91 | .DESCRIPTION 92 | 93 | .NOTES 94 | Version: 0.1.0 95 | Author: Jon Colon 96 | 97 | .EXAMPLE 98 | 99 | .LINK 100 | 101 | #> 102 | [CmdletBinding()] 103 | [OutputType([String])] 104 | Param ( 105 | [Parameter ( 106 | Position = 0, 107 | Mandatory)] 108 | [AllowEmptyString()] 109 | $OBJECT 110 | ) 111 | 112 | if (Get-View $OBJECT -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Name -Unique) { 113 | return Get-View $OBJECT -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Name -Unique 114 | } else { 115 | return $OBJECT 116 | } 117 | } # end 118 | 119 | function ConvertTo-HashToYN { 120 | <# 121 | .SYNOPSIS 122 | Used by As Built Report to convert array content true or false automatically to Yes or No. 123 | .DESCRIPTION 124 | 125 | .NOTES 126 | Version: 0.2.0 127 | Author: Jonathan Colon 128 | 129 | .EXAMPLE 130 | 131 | .LINK 132 | 133 | #> 134 | [CmdletBinding()] 135 | [OutputType([System.Collections.Specialized.OrderedDictionary])] 136 | Param ( 137 | [Parameter (Position = 0, Mandatory)] 138 | [AllowEmptyString()] 139 | [System.Collections.Specialized.OrderedDictionary] $TEXT 140 | ) 141 | 142 | $result = [ordered] @{} 143 | foreach ($i in $TEXT.GetEnumerator()) { 144 | try { 145 | $result.add($i.Key, (ConvertTo-TextYN $i.Value)) 146 | } catch { 147 | $result.add($i.Key, ($i.Value)) 148 | } 149 | } 150 | if ($result) { 151 | return $result 152 | } else { return $TEXT } 153 | } # end --------------------------------------------------------------------------------