Citrix XenDesktop / XenApp 7.x PowerShell Documentation Script
Hi everyone,
I think you all know the absolute fantastic PowerShell Documentation Scripts for Citrix XenApp (up to 6.5) and PVS created by Carl Webster. With these scripts it’s absolutely easy to create a Documentation of a XenApp- or PVS-Farm. Unfortunately Carl didn’t create (or release) a documentation script for XenDesktop / XenApp 7.x yet, so I decided to create my own script. It’s not comparable (and actually that’s not my intention) to Carls scripts but documents the following things (in a more basic way):
- General Site Informations
- Logging Settings
- Licensing
- Controllers
- Databases
- Administrators
- Machine Catalogs
- Applications
- Storefront Servers (not the StoreFront Servers)
- App-V Server
The following main things are missing:
- Policies
- Hosting
The script is divided into two files:
jhmeier-xd7-xa-7.x-documentation-v03.ps1
en-US.xml
The first file is the script himself, while the second file is for an easy modification of the script-output for other languages.
Script Usage
To use the scripts a few prerequisites must be fulfilled:
- XenDesktop / XenApp PowerShell Extensions
- Microsoft Word
- XenDesktop / XenApp Admin Account (with at least Read privileges)
- PowerShell Execution Policy
- The script and the language file need to be in the same location.
That should it be – just execute the script. The script starts and creates an (invisible) Word-Document in the background. When it’s finished it saves the document with the name XD-XA-SITE-NAME.docx in the script folder.
Parameters
The script supports (but doesn’t need) the following parameters:
-TextLanguage en-US
If you don’t want to have an output in the default language (English) you need to define the wanted language. Attention: Therefore you need a separate language xml file – see Language Files.
-DeliveryControllerAddress DeliveryControllerFQDN
If you run the script without this parameter it tries to connect to localhost – but if that’s not a Delivery Controller you need to specify it
Language Files
If you run the script – without creating a language specific xml file – the output looks like this:
Description: Description in the System language
If that’s ok for you – you have nothing to do – but if you prefer a complete output in your language like (in German):
Beschreibung: Beschreibung in Deutsch
you need to copy the file en-US.xml and rename it to e.g. de-DE.xml. After that open the new file with an editor of your choice. You now find a lot of entries which look like the following:
<Description>Description</Description>
Now you need to translate the middle for every necessary line so that it looks like this:
<Description>Beschreibung</Description>
License
The script is published under the GPL.
Download
jhmeier-xd-xa-7.x-documentation-v03.zip
Feedback
Any feedback would be really welcome – if you have something to make the script better or have any questions – feel free to contact me.
That’s it – hopefully the script is useful for some of you.
Hello, I have written some scripts with Carl Webster and I would like to take your base and enhance it with adding html output as well as word options so that it can be generated without word present. Would you mind if I work on this and will send you what I think would be a good documenter?
Hello Ken. Yes of course – every improvement is realy welcome 🙂 Looking Forward to your improvements 🙂 If you I can assist you with anything give me an Information.
Hi, I tried to run your script on a XD7.5 DDC but I’m missing word due to not having Word installed on such a VM usually. When running the script on a Worker (where Word 2010 is installed) I’m missing all required Citrix Snapins (Set-PSSnapin Citrix* results in an error stating “No Windows PowerShell snap-ins matching the pattern ‘Citrix*’ were found”) . How can I install the required Citrix Snapins?
Regards, Alex
Hi Alex,
the PSSnapins should be avaialable if you install the Desktop Studio on your Worker.
Hello, I need to prepare a document for my xendesktop 7.1 environment and found your script but I am not able to run the script remotely from my windows7 system.
I need to know the steps to follow to get the script output, please help.
Not sure where to put “-DeliveryControllerAddress DeliveryControllerFQDN” in the script. Lot of error is coming like below:
Import-Module : The specified module ‘Citrix.*’ was not loaded because no valid module file was found in any module
directory.
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:20 char:9
+ Import-Module Citrix.*
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (Citrix.*:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
Get-ConfigSite : An invalid URL was given for the service. The value given was ‘localhost’.
The reason given was: Failed to connect to back-end server ‘localhost’ on port 80 using binding WSHttp. The serv
may be off-line or may not be running the appropriate service
There was no endpoint listening at http://localhost/Citrix/ConfigurationContract/v2 that could accept the messag
This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:80.
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:100 char:15
+ $SiteConfig = Get-ConfigSite -AdminAddress $DeliveryControllerAddress
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-ConfigSite], InvalidOperationException
+ FullyQualifiedErrorId : Citrix.XDPowerShell.Status.CommunicationError,Citrix.Configuration.Sdk.Cmdlets.Command
GetConfigSiteCommand
Get-BrokerController : Failed to connect to back-end server ‘localhost’ on port 80 using binding WSHttp. The server
may be off-line or may not be running the appropriate service
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:101 char:21
+ $BrokerController = Get-BrokerController -AdminAddress $DeliveryControllerAddres …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-BrokerController], SdkOperationException
+ FullyQualifiedErrorId : Citrix.XDPowerShell.Broker.NoServerErrorId,Citrix.Broker.Admin.SDK.GetBrokerController
mmand
Get-AdminRole : An invalid URL was given for the service. The value given was ‘localhost’.
The reason given was: Failed to connect to back-end server ‘localhost’ on port 80 using binding WSHttp. The serv
may be off-line or may not be running the appropriate service
There was no endpoint listening at http://localhost/Citrix/DelegatedAdminContract/v1 that could accept the
message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more detai
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:80.
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:102 char:15
+ $AdminRoles = Get-AdminRole -AdminAddress $DeliveryControllerAddress
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-AdminRole], InvalidOperationException
+ FullyQualifiedErrorId : Citrix.XDPowerShell.Status.CommunicationError,Citrix.DelegatedAdmin.Sdk.Commands.GetAd
nRoleCommand
Get-BrokerCatalog : Failed to connect to back-end server ‘localhost’ on port 80 using binding WSHttp. The server may
be off-line or may not be running the appropriate service
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:103 char:18
+ $BrokerCatalog = Get-BrokerCatalog -AdminAddress $DeliveryControllerAddress
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-BrokerCatalog], SdkOperationException
+ FullyQualifiedErrorId : Citrix.XDPowerShell.Broker.NoServerErrorId,Citrix.Broker.Admin.SDK.GetBrokerCatalogCom
nd
Get-BrokerDesktopGroup : Failed to connect to back-end server ‘localhost’ on port 80 using binding WSHttp. The serve
may be off-line or may not be running the appropriate service
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:104 char:23
+ $BrokerDesktopGroup = Get-BrokerDesktopGroup -AdminAddress $DeliveryControllerAd …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-BrokerDesktopGroup], SdkOperationException
+ FullyQualifiedErrorId : Citrix.XDPowerShell.Broker.NoServerErrorId,Citrix.Broker.Admin.SDK.GetBrokerDesktopGro
Command
Get-BrokerApplication : Failed to connect to back-end server ‘localhost’ on port 80 using binding WSHttp. The server
may be off-line or may not be running the appropriate service
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:105 char:17
+ $Applications = Get-BrokerApplication -AdminAddress $DeliveryControllerAddress
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-BrokerApplication], SdkOperationException
+ FullyQualifiedErrorId : Citrix.XDPowerShell.Broker.NoServerErrorId,Citrix.Broker.Admin.SDK.GetBrokerApplicatio
ommand
Get-XDLogging : The term ‘Get-XDLogging’ is not recognized as the name of a cmdlet, function, script file, or operab
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:106 char:14
+ $XDLogging = Get-XDLogging -AdminAddress $DeliveryControllerAddress
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-XDLogging:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Get-AdminDBConnection : An invalid URL was given for the service. The value given was ‘localhost’.
The reason given was: Failed to connect to back-end server ‘localhost’ on port 80 using binding WSHttp. The serv
may be off-line or may not be running the appropriate service
There was no endpoint listening at http://localhost/Citrix/DelegatedAdminContract/v1 that could accept the
message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more detai
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:80.
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:107 char:22
+ $AdminDBConnection = Get-AdminDBConnection -AdminAddress $DeliveryControllerAddr …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-AdminDBConnection], InvalidOperationException
+ FullyQualifiedErrorId : Citrix.XDPowerShell.Status.CommunicationError,Citrix.DelegatedAdmin.Sdk.Cmdlets.DataSt
e.Commands.GetAdminDBConnectionCommand
Get-MonitorDBConnection : The term ‘Get-MonitorDBConnection’ is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:108 char:24
+ $MonitorDBConnection = Get-MonitorDBConnection -DataStore Monitor -AdminAddress …
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-MonitorDBConnection:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Get-LogDBConnection : An invalid URL was given for the service. The value given was ‘localhost’.
The reason given was: Failed to connect to back-end server ‘localhost’ on port 80 using binding WSHttp. The serv
may be off-line or may not be running the appropriate service
There was no endpoint listening at http://localhost/Citrix/ConfigurationLoggingService/v1 that could accept the
message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more detai
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:80.
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:109 char:20
+ $LogDBConnection = Get-LogDBConnection -DataStore Logging -AdminAddress $Deliver …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-LogDBConnection], InvalidOperationException
+ FullyQualifiedErrorId : Citrix.XDPowerShell.Status.CommunicationError,Citrix.ConfigurationLogging.Sdk.Cmdlets.
taStore.Commands.GetLogDBConnectionCommand
General Site Informations
Logging
Licensing
Controllers
Databases
Administrators
Machine Catalogs
Delivery Groups
Applications
StoreFront Server
Get-BrokerMachineConfiguration : Failed to connect to back-end server ‘localhost’ on port 80 using binding WSHttp. T
server may be off-line or may not be running the appropriate service
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:712 char:16
+ $StoreFront1 = Get-BrokerMachineConfiguration -Name rs*
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-BrokerMachineConfiguration], SdkOperationException
+ FullyQualifiedErrorId : Citrix.XDPowerShell.Broker.NoServerErrorId,Citrix.Broker.Admin.SDK.GetBrokerMachineCon
gurationCommand
App-V Server
Get-BrokerMachineConfiguration : Failed to connect to back-end server ‘localhost’ on port 80 using binding WSHttp. T
server may be off-line or may not be running the appropriate service
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:777 char:10
+ $AppV1 = Get-BrokerMachineConfiguration -Name appv*
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-BrokerMachineConfiguration], SdkOperationException
+ FullyQualifiedErrorId : Citrix.XDPowerShell.Broker.NoServerErrorId,Citrix.Broker.Admin.SDK.GetBrokerMachineCon
gurationCommand
Exception calling “SaveAs” with “2” argument(s): “This is not a valid file name.
Try one or more of the following:
* Check the path to make sure it was typed correctly.
* Select a file from the list of files and folders.”
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:807 char:1
+ $doc.SaveAs([ref] $savepath, [ref] $SafeFormat::wdFormatDocument)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : COMException
Hello.
“-DeliveryControllerAddress DeliveryControllerFQDN”
is a Parameter – eg “documentation.ps1 -DeliveryControllerAddress DeliveryControllerFQDN”
Ok as a novice I managed to get some output but with some following errors:
Import-Module : The specified module ‘Citrix.*’ was not loaded because no valid module file was found in any module
directory.
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:20 char:9
+ Import-Module Citrix.*
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (Citrix.*:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
Get-XDLogging : The term ‘Get-XDLogging’ is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:106 char:14
+ $XDLogging = Get-XDLogging -AdminAddress $DeliveryControllerAddress
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-XDLogging:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Get-MonitorDBConnection : The term ‘Get-MonitorDBConnection’ is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At C:\Stuff\jhmeier-xd-xa-7.x-documentation-v03.ps1:108 char:24
+ $MonitorDBConnection = Get-MonitorDBConnection -DataStore Monitor -AdminAddress …
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-MonitorDBConnection:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
General Site Informations
Logging
Licensing
Controllers
Databases
Administrators
Machine Catalogs
Delivery Groups
Applications
StoreFront Server
App-V Server
You need to install the XenDesktop PowerShell SDK on your Computer.
I finally completed my XenApp/XenDesktop 7.x documentation script. It is available at http://CarlWebster.com/downloads
I tried to run the script but it’s stuck at “App-V Server” . Any ideas?
can you try to run with -verbose ?