Learn how to configure Citrix StoreFront multi-site aggregation with PowerShell. This is a must for complex enterprise environments, since the StoreFront console cannot be used for advanced configurations.
In older versions of StoreFront, you had to manually modify the web.config file located in the directory C:\inetpub\%IISDirectory%\Citrix\%StoreName% to be able to configure advanced settings. In the latest StoreFront versions, this is no longer necessary, since all necessary PowerShell cmdlets are now available.
In this article, I offer a complete PowerShell script to configure multi-site aggregation and user mapping, as well as a detailed explanation how to use this script.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
########################################################### # Create a multi-site aggregation set and map user groups # ########################################################### # Variables [edit] [int]$IISSiteID = 1 # The IIS site ID. If you only have one site ("Default Web Site"), the site ID is 1 [string]$StorePath = "/Citrix/MyStore" # The virtual path to the StoreFront store in the specific IIS site (e.g. "/Citrix/MyStore") [string]$EquivalentFarmsetName = "FarmSet1" # The unique name used to identify the new equivalent farm set (e.g. "FarmSet1") [string]$AggregationGroupName = "AggregationGroup1" # The name of the aggregation group (e.g. "AggregationGroup1"). The aggregation group can span multiple equivalent farm sets, so the name does NOT have to be unique per farm set [string[]]$PrimaryFarms = "MySite1","MySite2" # The sites you want to aggregate. Enter at least two farms/sites that need to be aggregated. It is possible to enter more than two farms/sites, but not less than two [string[]]$BackupFarms = "MyBackupSite1","MyBackupSite2" # The backup site(s) in case the main sites fail. Leave this value blank ("") if you have no backup farm $LoadBalanceMode = "LoadBalanced" # Load balancing or fail-over. Possible values are 'Failover' or 'LoadBalanced' [bool]$FarmsAreIdentical = $True # The sites that are aggregated are 100% identical or not. Possible values are either '$true' or '$false' [string[]]$ADGroupNames = "usrsCTX","Domain Users" # The AD group(s) you want to map/bind to the equivalent farm set. You can enter one or more AD groups and with or without specifying the domain (e.g. "MyDomain\ADGroup1", "ADGroup2") [string]$FarmMappingName = "FarmMapping$(Get-Random)" # The unique name used to identify the UserFarmMapping. This name has to be unique. The cmdlet "Get-Random" generates a random 32-bit number to make sure the name is unique Write-Host "Create a multi-site aggregation set and map user groups" Write-Host "" # Connect to the store Write-Host "Connect to the store (IIS site ID $IISSiteID; store path '$StorePath')" $store = Get-STFStoreService -siteID $IISSiteID -VirtualPath $StorePath # Create the equivalent farm set Write-Host "Create the equivalent farm set '$EquivalentFarmsetName'" $FarmSet = New-STFEquivalentFarmset -Name $EquivalentFarmsetName -AggregationGroupName $AggregationGroupName -PrimaryFarms $PrimaryFarms -LoadBalanceMode $LoadBalanceMode -FarmsAreIdentical $FarmsAreIdentical # 1) Retrieve the SID for each AD group defined in the variable $ADGroupNames # 2) Add the group name and the group's SID to a hash table ('dictionary object') Write-Host "Retrieve the SID for each AD group and add the SID to the hash table" $UserMappingGroups = @{} Foreach ( $ADGroup in $ADGroupNames ) { [string]$SID = (New-Object System.Security.Principal.NTAccount($ADGroup)).Translate([System.Security.Principal.SecurityIdentifier]).value Write-Host " -The SID for the AD group $ADGroup is $SID" $UserMappingGroups.Add($ADGroup,$SID) } # Map the AD group(s) to the equivalent farm set Write-Host "Map the AD groups (stored in the hash table) to the newly created equivalent farm set" Add-STFUserFarmMapping -StoreService $store -Name $FarmMappingName -GroupMembers $UserMappingGroups -EquivalentFarmSet $FarmSet Write-Host "" Write-Host "End of script" |
Read the entire article on the Citrix User Group Community (MyCUGC) website: Citrix StoreFront Multi-Site Aggregation with PowerShell.
For more information on how to automate the installation and configuration of Citrix StoreFront see the article Citrix Storefront Unattended Installation with PowerShell.
Dennis Span works as a Lead Account Technology Strategist at Cloud Software Group in Vienna, Austria. He holds multiple Citrix certifications (CCE-V). Dennis has been a Citrix Technology Advocate (CTA) since 2017 (+ one year as Citrix Technology Professional, CTP). Besides his interest in virtualization technologies and blogging, he loves spending time with his family as well as snowboarding, playing basketball and rowing. He is fluent in Dutch, English, German and Slovak and speaks some Spanish.
Hi Dennis,
Onderstaande link werkt niet (meer). Wellicht kun je de hyperlink bijwerken?
Read the entire article on the Citrix User Group Community (MyCUGC) website: Citrix StoreFront Multi-Site Aggregation with PowerShell.
Gr, Ufuk
Bedankt Ufuk! Ik heb de link net bijgewerkt. De MyCUGC website is een paar maanden geleden compleet vernieuwd. Daardoor zijn ook alle links veranderd.