Let’s suppose that you would like internal users to connect to the Citrix environment through Access Gateway to be able to perform security checks, but you would prefer that those users get an direct IP assigned instead of an STA. This is how to do…

Where StoreFront detects that a user has connected through a NetScaler Gateway, it will always arrange for XenApp/XenDesktop sessions to be established using a Secure Ticket Authority (STA) address, rather than the direct IP address. This is also true even where the user has established a Full VPN connection to the server LAN. To bypass this default behaviour it is necessary to modify StoreFront using the following PowerShell commands. The following commands inform StoreFront that, for a given Store, it should always arrange for direct IP addresses to be used instead of STA addresses.

From a StoreFront Console, identify the name of the Store that you wish to modify.
Close all StoreFront Consoles before running the following PowerShell script as Administrator.
Run the following three commands from a PowerShell prompt.
Note that the 2nd command begins dot space.

1. Set-ExecutionPolicy RemoteSigned
2. ‘C:\Program Files\Citrix\Receiver StoreFront\Scripts\ImportModules.ps1’
3. Set-DSFarmsWithNullOptimalGateway -SiteId 1 -ResourcesVirtualPath /Citrix/Store –AllFarms

• SiteId: The IIS Site Id, typically 1 unless IIS has been explicitly reconfigured by the administrator.
• ResourcesVirtualPath: The virtual path of the store to be modified. The preceding example modifies a store with the default name “Store”.

Exit from the PowerShell console before restarting any Storefront Consoles.