Documenting Citrix XenApp and XenDesktop 7.x with Microsoft PowerShell V2.0

FINALLY! After 14 months of development, almost 29,000 lines of PowerShell, many hours of my time and with the help of almost 200 testers, we are pleased to present you with Version 2.0 of the XenApp/XenDesktop 7.x documentation script. This script is for versions of XenApp/XenDesktop 7.8 and later. Version 1.xx is for XenApp/XenDesktop versions 7.0 through 7.7

First, I would like to thank my employer, Choice Solutions, for allowing me the time to do some of the development work on company time. I was able to use customer deployments to run the script and verify data and some of my fellow engineers at Choice submitted enhancement requests.

I would also like to thank the engineers at Citrix who helped me figure out how to retrieve and gather some data I just couldn’t figure out how to find.

I started work on this script as soon as I received a copy of 7.8 for testing. Before I could finish updating the script, 7.9 was released. And then came 7.11 and then 7.12 and now 7.13. WHEW! Maybe I can get a breath before the next version is released.

The script has been tested with the following versions of XenDesktop 7:

  • 7.8
  • 7.9
  • 7.11
  • 7.12
  • 7.13

Here are changes from version 1.20 which was the basis for this script:

  • Added “Launch in user’s home zone” to Delivery Group details
  • Added AppDisks
  • Added AppDNA and the ability to process just the AppDNA section
  • Added Break statements to most of the Switch statements
  • Added Chinese language support
  • Added Configuration Logging Preferences
    • Show correct database size, not the wrong size reported in Studio
  • Added Description to Machine Catalog details
  • Added Desktop Entitlement settings to Delivery Groups that are configured to deliver desktops
  • Added new policies
  • Added RemotePC OU and Subfolder properties to RemotePC Machine Catalog details
  • Added “Restrict launches to machines with tag” to Random/Desktops only and RemotePC Delivery Groups
  • Added Summary Report page
  • Added support for VDA versions 7.8 and 7.9 (which includes 7.11/7.12/7.13)
  • Added support for XenApp/XenDesktop 7.8, 7.9, 7.11, 7.12, 7.13
  • Added to machine catalog information for RemotePC, “No. of Machines” and “Allocated Machines”
  • Brought core functions up-to-date with the other scripts
  • Fix numerous typos
  • Fixed formatting issues with HTML headings output
  • Fixed French wording for Table of Contents 2 (Thanks to David Rouquier)
  • Fixed the “No. of machines” for Machine Catalogs so it is now accurate
  • Fixed the Machine Catalog details to match what is shown in Studio
  • For Machine Catalog details, for PVS provisioned catalogs, add the PVS Server address
  • For Persistent machines with changes stored on the local disk, added the “VM copy mode”
  • For Personal vDisk catalogs, added PvD size and drive letter
  • For Random catalog types (SingleSession and MultiSession), added “Temporary memory cache size (MB)” and “Temporary disk cache size (GB)”
  • Removed unnecessary blank lines in policy value output
  • Removed snapin citrix.common.commands as it is removed in 7.13 and no cmdlets are used from that snapin
  • Updated error message for missing snapins to state requires a 7.8 or later Controller
  • Updated help text
  • Updated Machine/Desktop details to match what is shown in Studio
  • Updated the Delivery Group details section with the changes to how “Delivering” is determined for XenApp Delivery Groups
  • Updated the Delivery Group “Restart Schedule” wording to match the changes in Studio
  • Updated the Delivery Group “Restart Schedule” to include the PowerShell only setting of “Restrict to tag” for 7.12 and later
  • Updated the Delivery Group section to match all the changes made in Studio
  • Updated version checking
    • Now display running version in error messages
  • Updated version checking registry access to allow 32-bit PowerShell access to 64-bit registry

As far as I know, this script documents every nook and cranny in Citrix Studio that I can find. The following is documented:

  • Machines Catalogs
    • Optionally, details on every machine in every catalog
  • AppDisks
    • Optionally, details on every AppDisk
  • Delivery Groups
    • Optionally, details on every machine (desktop) in every group
  • Applications
    • Optionally, details for every application
    • Application Groups
  • Policies
    • Optionally, details for all 339 XenDesktop 7.x Site and Active Directory (AD) based Citrix policies
  • Logging
    • Optionally, details for a date range
  • Site Configuration
  • Administrators
  • Controllers
  • Hosting
    • Optionally, basic details for every machine using a hosting connection
  • Licensing
  • StoreFront
  • App-V Publishing
  • AppDNA
  • Zones

When a machine catalog or delivery group is double-clicked in Studio a list of machines in that catalog or group are shown. If you right-click on the column header row and click Select Columns, there are a lot of columns to chose from as shown in Figures 1 and 2.

Figure 1

Figure 1 (Desktop OS)

Figure 2

Figure 2 (Server OS)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I decided to include every column in the optional machine details. The same details are also used for delivery groups. If you decide to use both machine catalog details and delivery group details, your report will be extremely long and take an exceptionally long time to run. I recommend you chose one or neither.

This is now the largest script I have written at 28,944 lines! The original XenDesktop 5.x script was 10,770 lines and the original XenApp/XenDesktop 7.x V1 script was 22,315 lines.

I hope you enjoy what I and the almost 200 testers have created for you.

The script has detailed help text to explain all the parameters.

NAME
    C:\XAXDV2Script\XD7_Inventory_V2.ps1

SYNOPSIS
    Creates an inventory of a Citrix XenDesktop 7.8+ Site.

SYNTAX
    C:\XAXDV2Script\XD7_Inventory_V2.ps1 [-MSWord] [-AdminAddress <String>] [-MachineCatalogs] [-AppDisks]
    [-DeliveryGroups] [-DeliveryGroupsUtilization] [-Applications] [-Policies] [-NoPolicies] [-NoADPolicies]
    [-Logging] [-Administrators] [-Hosting] [-StoreFront] [-StartDate <DateTime>] [-EndDate <DateTime>] [-AddDateTime]
    [-Hardware] [-Section <String>] [-Folder <String>] [-CompanyName <String>] [-CoverPage <String>] [-UserName
    <String>] [<CommonParameters>]

    C:\XAXDV2Script\XD7_Inventory_V2.ps1 [-MSWord] [-PDF] [-Text] [-HTML] [-AdminAddress <String>] [-MachineCatalogs]
    [-AppDisks] [-DeliveryGroups] [-DeliveryGroupsUtilization] [-Applications] [-Policies] [-NoPolicies]
    [-NoADPolicies] [-Logging] [-Administrators] [-Hosting] [-StoreFront] [-StartDate <DateTime>] [-EndDate
    <DateTime>] [-AddDateTime] [-Hardware] [-Section <String>] [-Folder <String>] [-CompanyName <String>] [-CoverPage
    <String>] [-UserName <String>] -SmtpServer <String> [-SmtpPort <Int32>] [-UseSSL] -From <String> -To <String>
    [<CommonParameters>]

    C:\XAXDV2Script\XD7_Inventory_V2.ps1 [-PDF] [-AdminAddress <String>] [-MachineCatalogs] [-AppDisks]
    [-DeliveryGroups] [-DeliveryGroupsUtilization] [-Applications] [-Policies] [-NoPolicies] [-NoADPolicies]
    [-Logging] [-Administrators] [-Hosting] [-StoreFront] [-StartDate <DateTime>] [-EndDate <DateTime>] [-AddDateTime]
    [-Hardware] [-Section <String>] [-Folder <String>] [-CompanyName <String>] [-CoverPage <String>] [-UserName
    <String>] [<CommonParameters>]

    C:\XAXDV2Script\XD7_Inventory_V2.ps1 [-Text] [-AdminAddress <String>] [-MachineCatalogs] [-AppDisks]
    [-DeliveryGroups] [-DeliveryGroupsUtilization] [-Applications] [-Policies] [-NoPolicies] [-NoADPolicies]
    [-Logging] [-Administrators] [-Hosting] [-StoreFront] [-StartDate <DateTime>] [-EndDate <DateTime>] [-AddDateTime]
    [-Hardware] [-Section <String>] [-Folder <String>] [<CommonParameters>]

    C:\XAXDV2Script\XD7_Inventory_V2.ps1 [-HTML] [-AdminAddress <String>] [-MachineCatalogs] [-AppDisks]
    [-DeliveryGroups] [-DeliveryGroupsUtilization] [-Applications] [-Policies] [-NoPolicies] [-NoADPolicies]
    [-Logging] [-Administrators] [-Hosting] [-StoreFront] [-StartDate <DateTime>] [-EndDate <DateTime>] [-AddDateTime]
    [-Hardware] [-Section <String>] [-Folder <String>] [<CommonParameters>]

DESCRIPTION
    Creates an inventory of a Citrix XenDesktop 7.8+ Site using Microsoft PowerShell, Word,
    plain text or HTML.

    This script requires at least PowerShell version 3 but runs best in version 5.

    Word is NOT needed to run the script. This script will output in Text and HTML.

    You do NOT have to run this script on a Controller. This script was developed and run
    from a Windows 10 VM.

    You can run this script remotely using the –AdminAddress (AA) parameter.

    This script supports versions of XenApp/XenDesktop starting with 7.8.

    By default, only gives summary information for:
        Machine Catalogs
        AppDisks
        Delivery Groups
        Applications
        Application Groups
        Policies
        Logging
        Administrators
        Hosting
        StoreFront
        App-V Publishing
        AppDNA
        Zones

    The Summary information is what is shown in the top half of Citrix Studio for:
        Machine Catalogs
        AppDisks
        Delivery Groups
        Applications
        Policies
        Logging
        Administrators
        Hosting
        StoreFront

    Using the MachineCatalogs parameter can cause the report to take a very long time to complete
    and can generate an extremely long report.

    Using the DeliveryGroups parameter can cause the report to take a very long time to complete
    and can generate an extremely long report.

    Using both the MachineCatalogs and DeliveryGroups parameters can cause the report to take an
    extremely long time to complete and generate an exceptionally long report.

    Creates an output file named after the XenDesktop 7.8+ Site.

    Word and PDF Document includes a Cover Page, Table of Contents and Footer.
    Includes support for the following language versions of Microsoft Word:
        Catalan
        Chinese
        Danish
        Dutch
        English
        Finnish
        French
        German
        Norwegian
        Portuguese
        Spanish
        Swedish

PARAMETERS
    -MSWord [<SwitchParameter>]
        SaveAs DOCX file
        This parameter is set True if no other output format is selected.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -PDF [<SwitchParameter>]
        SaveAs PDF file instead of DOCX file.
        This parameter is disabled by default.
        The PDF file is roughly 5X to 10X larger than the DOCX file.
        This parameter requires Microsoft Word to be installed.
        This parameter uses the Word SaveAs PDF capability.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -Text [<SwitchParameter>]
        Creates a formatted text file with a .txt extension.
        This parameter is disabled by default.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -HTML [<SwitchParameter>]
        Creates an HTML file with an .html extension.
        This parameter is disabled by default.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -AdminAddress <String>
        Specifies the address of a XenDesktop controller the PowerShell snapins will connect to.
        This can be provided as a host name or an IP address.
        This parameter defaults to LocalHost.
        This parameter has an alias of AA.

        Required?                    false
        Position?                    named
        Default value                LocalHost
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -MachineCatalogs [<SwitchParameter>]
        Gives detailed information for all machines in all Machine Catalogs.

        Using the MachineCatalogs parameter can cause the report to take a very long
        time to complete and can generate an extremely long report.

        Using both the MachineCatalogs and DeliveryGroups parameters can cause the
        report to take an extremely long time to complete and generate an exceptionally
        long report.

        This parameter is disabled by default.
        This parameter has an alias of MC.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -AppDisks [<SwitchParameter>]
        Gives detailed information for all AppDisks.

        This parameter is disabled by default.
        This parameter has an alias of AD.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -DeliveryGroups [<SwitchParameter>]
        Gives detailed information for all desktops in all Desktop (Delivery) Groups.

        Using the DeliveryGroups parameter can cause the report to take a very long
        time to complete and can generate an extremely long report.

        Using both the MachineCatalogs and DeliveryGroups parameters can cause the
        report to take an extremely long time to complete and generate an exceptionally
        long report.

        This parameter is disabled by default.
        This parameter has an alias of DG.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -DeliveryGroupsUtilization [<SwitchParameter>]
        Gives a chart with the delivery group utilization for the last 7 days
        depending on the information in the database.

        This option is only available when the report is generated in Word and requires
        Micosoft Excel to be locally installed.

        Using the DeliveryGroupsUtilization parameter causes the report to take a longer time to
        complete and generates a longer report.

        This parameter is disabled by default.
        This parameter has an alias of DGU.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -Applications [<SwitchParameter>]
        Gives detailed information for all applications.
        This parameter is disabled by default.
        This parameter has an alias of Apps.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -Policies [<SwitchParameter>]
        Give detailed information for both Site and Citrix AD based Policies.

        Using the Policies parameter can cause the report to take a very long time
        to complete and can generate an extremely long report.

        There are three related parameters: Policies, NoPolicies and NoADPolicies.

        Policies and NoPolicies are mutually exclusive and priority is given to NoPolicies.

        This parameter is disabled by default.
        This parameter has an alias of Pol.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -NoPolicies [<SwitchParameter>]
        Excludes all Site and Citrix AD based policy information from the output document.

        Using the NoPolicies parameter will cause the Policies parameter to be set to False.

        This parameter is disabled by default.
        This parameter has an alias of NP.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -NoADPolicies [<SwitchParameter>]
        Excludes all Citrix AD based policy information from the output document.
        Includes only Site policies created in Studio.

        This switch is useful in large AD environments, where there may be thousands
        of policies, to keep SYSVOL from being searched.

        This parameter is disabled by default.
        This parameter has an alias of NoAD.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -Logging [<SwitchParameter>]
        Give the Configuration Logging report with, by default, details for the previous seven days.
        This parameter is disabled by default.
        This parameter has an alias of Log.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -Administrators [<SwitchParameter>]
        Give detailed information for Administrator Scopes and Roles.
        This parameter is disabled by default.
        This parameter has an alias of Admins.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -Hosting [<SwitchParameter>]
        Give detailed information for Hosts, Host Connections and Resources.
        This parameter is disabled by default.
        This parameter has an alias of Host.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -StoreFront [<SwitchParameter>]
        Give detailed information for StoreFront.
        This parameter is disabled by default.
        This parameter has an alias of SF.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -StartDate <DateTime>
        Start date for the Configuration Logging report.

        Format for date only is MM/DD/YYYY.

        Format to include a specific time range is "MM/DD/YYYY HH:MM:SS" in 24 hour format.
        The double quotes are needed.

        The default is today's date minus seven days.
        This parameter has an alias of SD.

        Required?                    false
        Position?                    named
        Default value                ((Get-Date -displayhint date).AddDays(-7))
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -EndDate <DateTime>
        End date for the Configuration Logging report.

        Format for date only is MM/DD/YYYY.

        Format to include a specific time range is "MM/DD/YYYY HH:MM:SS" in 24 hour format.
        The double quotes are needed.

        The default is today's date.
        This parameter has an alias of ED.

        Required?                    false
        Position?                    named
        Default value                (Get-Date -displayhint date)
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -AddDateTime [<SwitchParameter>]
        Adds a date time stamp to the end of the file name.
        Time stamp is in the format of yyyy-MM-dd_HHmm.
        June 1, 2017 at 6PM is 2017-06-01_1800.
        Output filename will be ReportName_2017-06-01_1800.docx (or .pdf).
        This parameter is disabled by default.
        This parameter has an alias of ADT.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -Hardware [<SwitchParameter>]
        Use WMI to gather hardware information on: Computer System, Disks, Processor and Network
        Interface Cards

        This parameter may require the script be run from an elevated PowerShell session
        using an account with permission to retrieve hardware information (i.e. Domain Admin or
        Local Administrator).

        Selecting this parameter will add to both the time it takes to run the script and size
        of the report.

        This parameter is disabled by default.
        This parameter has an alias of HW.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -Section <String>
        Processes a specific section of the report.
        Valid options are:
                Admins (Administrators)
                AppDisks
                AppDNA
                Apps (Applications)
                AppV
                Catalogs (Machine Catalogs)
                Config (Configuration)
                Controllers
                Groups (Delivery Groups)
                Hosting
                Licensing
                Logging
                Policies
                StoreFront
                Zones
                All
        This parameter defaults to All sections.

        Notes:
        Using Logging will force the Logging switch to True.
        Using Policies will force the Policies switch to True.
        If Policies is selected and the NoPolicies switch is used, the script will terminate.

        Required?                    false
        Position?                    named
        Default value                All
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -Folder <String>
        Specifies the optional output folder to save the output report.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -CompanyName <String>
        Company Name to use for the Cover Page.
        Default value is contained in HKCU:\Software\Microsoft\Office\Common\UserInfo\CompanyName or
        HKCU:\Software\Microsoft\Office\Common\UserInfo\Company, whichever is populated on the
        computer running the script.
        This parameter has an alias of CN.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -CoverPage <String>
        What Microsoft Word Cover Page to use.
        Only Word 2010, 2013 and 2016 are supported.
        (default cover pages in Word en-US)

        Valid input is:
                Alphabet (Word 2010. Works)
                Annual (Word 2010. Doesn't work well for this report)
                Austere (Word 2010. Works)
                Austin (Word 2010/2013/2016. Doesn't work in 2013 or 2016, mostly works in 2010 but
                                                Subtitle/Subject & Author fields need to be moved
                                                after title box is moved up)
                Banded (Word 2013/2016. Works)
                Conservative (Word 2010. Works)
                Contrast (Word 2010. Works)
                Cubicles (Word 2010. Works)
                Exposure (Word 2010. Works if you like looking sideways)
                Facet (Word 2013/2016. Works)
                Filigree (Word 2013/2016. Works)
                Grid (Word 2010/2013/2016. Works in 2010)
                Integral (Word 2013/2016. Works)
                Ion (Dark) (Word 2013/2016. Top date doesn't fit; box needs to be manually resized or font
                                                changed to 8 point)
                Ion (Light) (Word 2013/2016. Top date doesn't fit; box needs to be manually resized or font
                                                changed to 8 point)
                Mod (Word 2010. Works)
                Motion (Word 2010/2013/2016. Works if top date is manually changed to 36 point)
                Newsprint (Word 2010. Works but date is not populated)
                Perspective (Word 2010. Works)
                Pinstripes (Word 2010. Works)
                Puzzle (Word 2010. Top date doesn't fit; box needs to be manually resized or font
                                        changed to 14 point)
                Retrospect (Word 2013/2016. Works)
                Semaphore (Word 2013/2016. Works)
                Sideline (Word 2010/2013/2016. Doesn't work in 2013 or 2016, works in 2010)
                Slice (Dark) (Word 2013/2016. Doesn't work)
                Slice (Light) (Word 2013/2016. Doesn't work)
                Stacks (Word 2010. Works)
                Tiles (Word 2010. Date doesn't fit unless changed to 26 point)
                Transcend (Word 2010. Works)
                ViewMaster (Word 2013/2016. Works)
                Whisp (Word 2013/2016. Works)

        Default value is Sideline.
        This parameter has an alias of CP.
        This parameter is only valid with the MSWORD and PDF output parameters.

        Required?                    false
        Position?                    named
        Default value                Sideline
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -UserName <String>
        User name to use for the Cover Page and Footer.
        Default value is contained in $env:username
        This parameter has an alias of UN.
        This parameter is only valid with the MSWORD and PDF output parameters.

        Required?                    false
        Position?                    named
        Default value                $env:username
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -SmtpServer <String>
        Specifies the optional email server to send the output report.

        Required?                    true
        Position?                    named
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -SmtpPort <Int32>
        Specifies the SMTP port.
        The default is 25.

        Required?                    false
        Position?                    named
        Default value                25
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -UseSSL [<SwitchParameter>]
        Specifies whether to use SSL for the SmtpServer.
        The default is False.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -From <String>
        Specifies the username for the From email address.
        If SmtpServer is used, this is a required parameter.

        Required?                    true
        Position?                    named
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -To <String>
        Specifies the username for the To email address.
        If SmtpServer is used, this is a required parameter.

        Required?                    true
        Position?                    named
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see
        about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

INPUTS
    None.  You cannot pipe objects to this script.

OUTPUTS
    No objects are output from this script.  This script creates a Word, PDF
    plain text or HTML document.

NOTES
        NAME: XD7_Inventory_V2.ps1
        VERSION: 2.00
        AUTHOR: Carl Webster
        LASTEDIT: February 21, 2017

    -------------------------- EXAMPLE 1 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1

    Will use all default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.
    The computer running the script for the AdminAddress.

    -------------------------- EXAMPLE 2 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -AdminAddress DDC01

    Will use all default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.
    DDC01 for the AdminAddress.

    -------------------------- EXAMPLE 3 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -PDF

    Will use all default values and save the document as a PDF file.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.
    The computer running the script for the AdminAddress.

    -------------------------- EXAMPLE 4 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -TEXT

    Will use all default values and save the document as a formatted text file.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 5 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -HTML

    Will use all default values and save the document as an HTML file.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 6 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -MachineCatalogs

    Creates a report with full details for all machines in all Machine Catalogs.
    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 7 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -DeliveryGroups

    Creates a report with full details for all desktops in all Desktop (Delivery) Groups.
    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 8 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -DeliveryGroupsUtilization

    Creates a report with utilization details for all Desktop (Delivery) Groups.
    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 9 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -DeliveryGroups -MachineCatalogs

    Creates a report with full details for all machines in all Machine Catalogs and
    all desktops in all Delivery Groups.
    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 10 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -Applications

    Creates a report with full details for all applications.
    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 11 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -Policies

    Creates a report with full details for Policies.
    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 12 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -NoPolicies

    Creates a report with no Policy information.
    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 13 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -NoADPolicies

    Creates a report with no Citrix AD based Policy information.
    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 14 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -Policies -NoADPolicies

    Creates a report with full details on Site policies created in Studio but
    no Citrix AD based Policy information.

    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 15 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -Administrators

    Creates a report with full details on Administrator Scopes and Roles.

    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 16 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -Logging -StartDate 01/01/2017 -EndDate 01/31/2017

    Creates a report with Configuration Logging details for the dates 01/01/2017 through
    01/31/2017.

    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 17 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -Logging -StartDate "06/01/2017 10:00:00" -EndDate "06/01/2017 14:00:00"

    Creates a report with Configuration Logging details for the time range
    06/01/2017 10:00:00AM through 06/01/2017 02:00:00PM.

    Narrowing the report down to seconds does not work. Seconds must be either 00 or 59.

    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 18 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -Hosting

    Creates a report with full details for Hosts, Host Connections and Resources.
    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 19 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -StoreFront

    Creates a report with full details for StoreFront.
    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 20 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -MachineCatalogs -DeliveryGroups -Applications -Policies -Hosting -StoreFront

    Creates a report with full details for all:
        Machines in all Machine Catalogs
        Desktops in all Delivery Groups
        Applications
        Policies
        Hosts, Host Connections and Resources
        StoreFront
    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 21 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -MC -DG -Apps -Policies -Hosting

    Creates a report with full details for all:
        Machines in all Machine Catalogs
        Desktops in all Delivery Groups
        Applications
        Policies
        Hosts, Host Connections and Resources
    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 22 --------------------------

    PS C:\>PS C:\PSScript .\XD7_Inventory_V2.ps1 -CompanyName "Carl Webster Consulting" -CoverPage "Mod" -UserName "Carl Webster" -AdminAddress DDC01

    Will use:
        Carl Webster Consulting for the Company Name.
        Mod for the Cover Page format.
        Carl Webster for the User Name.
        Controller named DDC01 for the AdminAddress.

	-------------------------- EXAMPLE 23 --------------------------

    PS C:\>PS C:\PSScript .\XD7_Inventory_V2.ps1 -CN "Carl Webster Consulting" -CP "Mod" -UN "Carl Webster"

    Will use:
        Carl Webster Consulting for the Company Name (alias CN).
        Mod for the Cover Page format (alias CP).
        Carl Webster for the User Name (alias UN).
        The computer running the script for the AdminAddress.

    -------------------------- EXAMPLE 24 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -AddDateTime

    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    Adds a date time stamp to the end of the file name.
    Time stamp is in the format of yyyy-MM-dd_HHmm.
    June 1, 2017 at 6PM is 2017-06-01_1800.
    Output filename will be XD7SiteName_2017-06-01_1800.docx

    -------------------------- EXAMPLE 25 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -PDF -AddDateTime

    Will use all Default values and save the document as a PDF file.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    Adds a date time stamp to the end of the file name.
    Time stamp is in the format of yyyy-MM-dd_HHmm.
    June 1, 2017 at 6PM is 2017-06-01_1800.
    Output filename will be XD7SiteName_2017-06-01_1800.pdf

    -------------------------- EXAMPLE 26 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -Hardware

    Will use all default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    -------------------------- EXAMPLE 27 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -Folder \\FileServer\ShareName

    Will use all default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    Output file will be saved in the path \\FileServer\ShareName

    -------------------------- EXAMPLE 28 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -SmtpServer mail.domain.tld -From [email protected] -To [email protected]

    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    Script will use the email server mail.domain.tld, sending from [email protected], sending to [email protected]
    Script will use the default SMPTP port 25 and will not use SSL.
    If the current user's credentials are not valid to send email, the user will be prompted to enter valid
    credentials.

    -------------------------- EXAMPLE 29 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -SmtpServer smtp.office365.com -SmtpPort 587 -UseSSL -From [email protected] -To [email protected]

    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.

    Script will use the email server smtp.office365.com on port 587 using SSL, sending from [email protected],
    sending to [email protected]
    If the current user's credentials are not valid to send email, the user will be prompted to enter valid
    credentials.

    -------------------------- EXAMPLE 30 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -Section Policies

    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.
    Processes only the Policies section of the report.

    -------------------------- EXAMPLE 31 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -Section Groups -DG

    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.
    Processes only the Delivery Groups section of the report with Delivery Group details.

    -------------------------- EXAMPLE 32 --------------------------

    PS C:\PSScript >.\XD7_Inventory_V2.ps1 -Section Groups

    Will use all Default values.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\CompanyName="Carl Webster" or
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
    $env:username = Administrator

    Carl Webster for the Company Name.
    Sideline for the Cover Page format.
    Administrator for the User Name.
    Processes only the Delivery Groups section of the report with no Delivery Group details.

RELATED LINKS

I know that no matter how many testers I had that tested this script, it takes real world use to find all the bugs and little things that were overlooked. If you find a bug, an issue, a typo, some data I missed in Studio or have an enhancement request, send an email to [email protected]

NOTE: This script is continually updated. You can always find the most current version by going to http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

Thanks and enjoy

Webster

About Carl Webster

Webster is a Sr. Solutions Architect for Choice Solutions, LLC and specializes in Citrix, Active Directory and Technical Documentation. Webster has been working with Citrix products for many years starting with Multi-User OS/2 in 1990.

View all posts by Carl Webster

No comments yet.

Leave a Reply