How to Configure a Store Using PowerShell

How to Configure a Store Using PowerShell

book

Article ID: CTX206009

calendar_today

Updated On:

Description

This article lists and explains the commands to create and configure a store using PowerShell.


Instructions

1. Import StoreFront Modules to PowerShell

Run the following command using PowerShell:
"C:\Program Files\Citrix\Receiver StoreFront\Scripts\ImportModules.ps1“

2. Add a Store

Run the following command using PowerShell:
$SiteID = 1
$AuthenticationVirtualPath = "/Citrix/Authentication"
$authSummary = Get-DSAuthenticationServiceSummary -SiteID $SiteID -VirtualPath $AuthenticationVirtualPath
Install-DSStoreServiceAndConfigure -authSummary $authSummary -farmName FarmName -farmType XenApp -servers ddc1.domain.com -servicePort 8080 -siteId $SiteID -transportType HTTP -virtualPath /Citrix/Store -friendlyName Store -loadBalance $False

Description

  • $SiteID = variable to store the value of the Site ID which by default is 1 on IIS
  • $AuthenticationVirtualPath = Variable to store the value of the authentication path by default is “/ Citrix/Authentication”
  • $authSummary =  Variable to store both the SiteID and AuthenticationVirtualPath together
  • Install-DSStoreServiceAndConfigure: Command to create a store and configure it
  • –authSummary = switch that will use the information created earlier in our $authSummary variable
  • –farmName = Display name of the Delivery controller Farm
  • –farmType = Type of the farm. Allowed values: XenApp, XenDesktop and AppController
  • –servers = List of server names that are part of the farm
  • –servicePort = Port on which to contact the XML endpoint
  • –siteID = The IIS site where to create the service
  • –transportType = Transport to use. Allowed values: HTTP, HTTPS and SSL
  • –virtualPath = The virtual path location where to create the service. Example: /Citrix/Store
  • –FriendlyName = The friendly name to assign to the Store
  • –loadBalance = Whether the delivery controller servers should be contacted in load balancer mode.   If set to false, the servers are contacted in failover mode, in order specified. Values: $True or $False

3. Add Receiver for Web Site for the Store

Run the following command using PowerShell:
Install-DSWebReceiver -FriendlyName "Store Receiver" -SiteId 1 -StoreUrl https://storefrontBaseUrlFqdn/Citrix/Store -UseHttps $True -VirtualPath /Citrix/StoreWeb

Description

  • Install-DSWebReceiver = Command to create a Receiver for Web Site for a existing Store
  • –friendlyName = The friendly name to assign to the Receiver for Web site
  • –SiteId = The IIS site where to create the service
  • –StoreUrl = the full path of the store that we want to create a receiver for Web site for. Example: https://storefrontbaseUrlFqdn/Citrix/Store
  • –UseHttps = if the site will be using https as protocol. Values: $True or $False
  • –VirtualPath = The virtual path location where to create the service. Example /Citrix/StoreWeb

4. Add a Gateway Appliance

Run the following command using PowerShell:
Add-DSGlobalV10Gateway -Address https://nsgateway.domain.com -Id 1 -Logon Domain -Name nsgateway -CallbackUrl https://nsgateway.domain.com -IsDefault $True -RequestTicketTwoSTA $False -SecureTicketAuthorityUrls http://10.25.232.140:8080 -SessionReliability $False

Description

  • Add-DSGlobalV10Gateway = Command to add a gateway appliance
  • –Address  = The URL that will be used for External users
  • –Id = String to define the ID of the gateway. Example: 1
  • –Logon = The logon type used by the gateway. Values: Domain, RSA, DomainAndRSA, GatewayKnows, SmartCard, None.
  • –Name = The friendly name to assign to the Gateway Appliance
  • –CallbackUrl = the callback URL for the gateway
  • –IsDefault = decide if the gateway will be the default one for the Beacon Use. Values: $True or $False
  • –RequestTicketTwoSta = if you want to enable request two STA tickets. Values:   $True or $False
  • –SecureTicketAuthorityUrls = STAs that will be used. Example: http://stafqdn
  • –SessionReliability = to enable session reliability. Values: $True or $False

5. Enable Remote Access to a Store

Run the following command using PowerShell:
Set-DSStoreRemoteAccess -RemoteAccessType StoresOnly -SiteId 1 -VirtualPath /Citrix/Store

Description

  • Set-DSStoreRemoteAccess = Command to enable remote access to an existing store
  • –RemoteAccessType = Values: FullVPN, None, StoresOnly
  • –SiteId = The IIS site where to create the service
  • –VirtualPath = The virtual path location where to create the service. Example: /Citrix/Store

6. Set the Gateway Appliance(s) to a Store

Run the following command using PowerShell:
$gateway = Get-DSGlobalGateway -GatewayId 1
Set-DSStoreGateways -SiteId 1 -VirtualPath "/Citrix/Store" -Gateways $gateway

Description

  • -$gateway = Variable to store the value of the ID of the Gateway created on Step 3. Make sure that on the parameter –GatewayId you specify is the same as the parameter –Id on Step 3.
  • Set-DSStoreGateways = Command to set the gateway to an existing store
  • –SiteId = The IIS site where to create the service
  • –VirtualPath = The virtual path location where to create the service. Example: /Citrix/Store
  • –Gateways = Use the variable $gateway recently created to put the gateways information

7. Set an Internal Beacon

By default, the internal beacon is the same Storefront Base URL. To change the defaults and specify a new internal beacon run the following command:
Set-DSGlobalInternalBeacon -BeaconAddress https://internal.domain.com -BeaconId 1

Description

  • Set-DSGlobalInternalBeacon = Command to change the default internal beacon
  • –BeaconAddress = The address of the beacon you want to specify
  • –BeaconId = String to identify the beacon

8. Set an External Beacon

By default, when you create a NetScaler appliance and enable remote access to a store, StoreFront will automatically add 2 beacons:
https://netscalerApplianceFqdn
http://www.citrix.com

If you want to add additional external beacons run the following command:
Add-DSGlobalExternalBeacon -BeaconAddress https://external1.domain.com -BeaconId 2

Description

  • Add-DSGlobalExternalBeacon = Command to add an external beacon
  • –BeaconAddress = The address of the beacon you want to specify
  • –BeaconId = String to identify the beacon

Environment

The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.

Issue/Introduction

This article lists and explains the commands to create and configure a store using PowerShell.