PowerShell functions for Citrix

This page contains an overview and detailed description of all Citrix functions included in the Dennis Span PowerShell function library. You can download the PowerShell module file on the main page PowerShell function library.

Table of Contents

Provisioning Server

DS_CreatePVSAuthGroup

Use this function to create a new Provisioning Server authorization group.

  • Description:
    Create a new Provisioning Server authorization group.
  • Parameters:
    • GroupName
      This parameter contains the name of the Active Directory group which is to be added as an authorization group in the Provisioning Server farm.
      Please be aware that the notation MyDomain\MyGroup does not work! The string has be in LDAP-like format: MyDomain.com/MyOU/MyOU/MyGroup.
  • Example:
    DS_CreatePVSAuthGroup -GroupName "company.com/AdminGroup/CTXFarmAdmins"
    Creates the authorization group company.com/AdminGroup/CTXFarmAdmins.

DS_GrantPVSAuthGroupAdminRights

Use this function to grant an existing Provisioning Server authorization group farm, site or collection admin rights.

  • Description:
    Grant an existing Provisioning Server authorization group farm, site or collection admin rights.
  • Parameters:
    • GroupName
      This parameter contains the name of the existing Provisioning Server authorization group that is to be granted farm, site or collection admin rights. If the parameters Sitename and CollectionName are left empty, the
      authorization group is granted farm admin rights.
      Please be aware that the notation MyDomain\MyGroup does not work! The string has be in LDAP-like format: MyDomain.com/MyOU/MyOU/MyGroup.
    • SiteName
      This parameter is optional and contains the site name. If only the site name is specified (without the CollectionName parameter), the Provisioning Server authorization group is granted site admin rights.
    • CollectionName
      This parameter is optional and contains the name of the collection. You also have to specify the site name if your want to grant collection admin rights.
  • Example 1:
    DS_GrantPVSAuthGroupAdminRights -GroupName "company.com/AdminGroup/CTXFarmAdmins"
    Grants the authorization group company.com/AdminGroup/CTXFarmAdmins farm admin rights.
  • Example 2:
    DS_GrantPVSAuthGroupAdminRights -GroupName "company.com/AdminGroup/CTXSiteAdmins" -SiteName "MySite"
    Grants the authorization group company.com/AdminGroup/CTXSiteAdmins site admin rights.
  • Example 3:
    DS_GrantPVSAuthGroupAdminRights -GroupName "company.com/AdminGroup/CTXCollectionAdmins" -SiteName "MySite" -CollectionName "MyCollection"
    Grants the authorization group company.com/AdminGroup/CTXCollectionAdmins collection admin rights.

StoreFront

DS_CreateStoreFrontStore

Use this function to create single-site or multi-site StoreFront deployment, stores, farms and the Authentication, Receiver for Web and PNAgent services.

  • Description
    Creates a single-site or multi-site StoreFront deployment, stores, farms and the Authentication, Receiver for Web and PNAgent services.
  • Parameters:
    • FriendlyName
      [Optional] This parameter configures the friendly name of the store, for example MyStore or Marketing.
      If this parameter is omitted, the script generates the friendly name automatically based on the farm name. For example, if the farm name is MyFarm, the friendly name would be Store - MyFarm.
    • HostBaseUrl
      [Mandatory] This parameter determines the URL of the IIS site (the StoreFront "deployment"), for example https://mysite.com or http://mysite.com.
    • CertSubjectName
      [Optional] This parameter determines the Certificate Subject Name of the certificate you want to bind to the IIS SSL port on the local StoreFront server
      Possible values are:

      • Local machine name: $($env:ComputerName).mydomain.local
      • Wilcard / Subject Alternative Name (SAN) certificate: *.mydomain.local or portal.mydomain.local
        If this parameter is omitted, the Certificate Subject Name will be automatically extracted from the host base URL.
    • AddHostHeaderToIISSiteBinding
      [Optional] This parameter determines whether the host base URl (the host name) is added to IIS site binding.
      If this parameter is omitted, the value is set to $False and the host base URl (the host name) is NOT added to IIS site binding
    • IISSiteDir
      [Optional] This parameter contains the directory path to the IIS site. This parameter is only used in multiple deployment configurations whereby multiple IIS sites are created.
      If this parameter is omitted, a directory will be automatically generated by the script.
    • Farmtype
      [Optional] This parameter determines the farm type. Possible values are: XenDesktop | XenApp | AppController | VDIinaBox.
      If this parameter is omitted, the default value XenDesktop is used.
    • FarmName
      [Mandatory] This parameter contains the name of the farm within the store. The farm name should be unique within a store.
    • FarmServers
      [Mandatory] This parameter, which data type is an array, contains a list of farm servers (XML brokers or Delivery Controller). Enter the list comma separated (e.g. -FarmServers "Server1","Server2","Server3").
    • StoreVirtualPath
      [Optional] This parameter contains the partial path of the StoreFront store, for example: -StoreVirtualPath "/Citrix/MyStore" or -StoreVirtualPath "/Citrix/Store1".
      If this parameter is omitted, the default value /Citrix/Store is used.
    • ReceiverVirtualPath
      [Optional] This parameter contains the partial path of the Receiver for Web site in the StoreFront store, for example: -ReceiverVirtualPath "/Citrix/MyStoreWeb" or -ReceiverVirtualPath "/Citrix/Store1ReceiverWeb".
      If this parameter is omitted, the default value /Citrix/StoreWeb is used.
    • SSLRelayPort
      [Mandatory] This parameter contains the SSL Relay port (XenApp 6.5 only) used for communicating with the XenApp servers. Default value is 443 (HTTPS).
    • LoadBalanceServers
      [Optional] This parameter determines whether to load balance the Delivery Controllers or to use them in failover order (if specifying more than one server)
      If this parameter is omitted, the default value $False is used, which means that failover is used instead of load balancing
    • XMLPort
      [Optional] This parameter contains the XML service port used for communicating with the XenApp\XenDesktop servers. Default values are 80 (HTTP) and 443 (HTTPS), but you can also use other ports (depending on how you configured your XenApp/XenDesktop servers).
      If this parameter is omitted, the default value 80 is used.
    • HTTPPort
      [Optional] This parameter contains the port used for HTTP communication on the IIS site. The default value is 80, but you can also use other ports.
      If this parameter is omitted, the default value 80 is used.
    • HTTPSPort
      [Optional] This parameter contains the port used for HTTPS communication on the IIS site. If this value is not set, no HTTPS binding is created.
    • TransportType
      [Optional] This parameter contains the type of transport to use for the XML service communication. Possible values are: HTTP | HTTPS | SSL
      If this parameter is omitted, the default value HTTP is used.
    • EnablePNAgent
      [Mandatory] This parameter determines whether the PNAgent site is created and enabled. Possible values are: $True | $False
      If this parameter is omitted, the default value $True is used.
    • PNAgentAllowUserPwdChange
      [Optional] This parameter determines whether the user is allowed to change their password on a PNAgent. Possible values are: $True | $False.
      Note: this parameter can only be used if the logon method for PNAgent is set to prompt.
      Only add this parameter when the parameter EnablePNAgent is set to $True! If this parameter is omitted, the default value $True is used.
    • PNAgentDefaultService
      [Optional] This parameter determines whether this PNAgent site is the default PNAgent site in the store. Possible values are: $True | $False.
      Only add this parameter when the parameter EnablePNAgent is set to $True. If this parameter is omitted, the default value $True is used.
    • LogonMethod
      [Optional] This parameter determines the logon method for the PNAgent site. Possible values are: Anonymous | Prompt | SSON | Smartcard_SSON | Smartcard_Prompt. Only one value can be used at a time.
      Only add this parameter when the parameter EnablePNAgent is set to $True. If this parameter is omitted, the default value SSON (Single Sign-On) is used.
  • Example 1:
    DS_CreateStoreFrontStore -FriendlyName "MyStore" -HostBaseUrl "https://myurl.com" -FarmName "MyFarm" -FarmServers "Server1","Server2" -EnablePNAgent $True
    Creates a basic StoreFront deployment, a XenDesktop store, farm, Receiver for Web site and a PNAgent site. The communication with the Delivery Controllers uses the default XML port 80 and transport type HTTP.
    The above example uses only the 4 mandatory parameters and does not include any of the optional parameters.
    In case the HostBaseUrl is different than an already configured one on the local StoreFront server, a new IIS site is automatically created.
  • Example 2:
    DS_CreateStoreFrontStore -HostBaseUrl "https://myurl.com" -FarmName "MyFarm" -FarmServers "Server1","Server2" -StoreVirtualPath "/Citrix/MyStore" -ReceiverVirtualPath "/Citrix/MyStoreWeb" -XMLPort 443 -TransportType "HTTPS" -EnablePNAgent $True -PNAgentAllowUserPwdChange $False -PNAgentDefaultService $True -LogonMethod "Prompt"
    Creates a StoreFront deployment, a XenDesktop store, farm, Receiver for Web site and a PNAgent site. The communication with the Delivery Controllers uses port 443 and transport type HTTPS (please make sure that your Delivery Controller is listening on port 443!).
    PNAgent users are not allowed to change their passwords and the logon method is "prompt" instead of the default SSON (= Single Sign-On).
    In case the HostBaseUrl is different than an already configured one on the local StoreFront server, a new IIS site is automatically created.
  • Example 3:
    DS_CreateStoreFrontStore -HostBaseUrl "https://anotherurl.com" -FarmName "MyFarm" -FarmServers "Server1","Server2" -EnablePNAgent $False
    Creates a StoreFront deployment, a XenDesktop store, farm and Receiver for Web site, but DOES NOT create and enabled a PNAgent site. The communication with the Delivery Controllers uses the default XML port 80 and transport type HTTP.
    In case the HostBaseUrl is different than an already configured one on the local StoreFront server, a new IIS site is automatically created.