The Citrix Cloud Connector is a component installed in your resource locations (whether on-premises or public cloud) that allows for secure communication between that resource location and the Citrix Cloud management plane. This component is installed on a Windows Server VM and we recommend at least two for each resource location in order to ensure high-availability. It’s a straightforward, lightweight install, though in some instances you may wish to automate the install for larger environments, environments that are somewhat dynamic, dev and/or test, or other reasons. This will be the focus of the blog post.

For additional details on the Cloud Connector, refer to this page on Citrix Docs.

To start, I’d suggest reviewing Joel Katterman’s excellent blog post on Cloud Connector automation here. He covers some key concepts and deployment strategies that we’ll build upon. One update to that blog, though, is around the use of Invoke-WebRequest to download the Connector. Due to its implementation, our engineering team has observed slow performance with it leading to timeouts. The recommended approach nowadays is using the .NET webclient or mitigate it by setting the $ProgressPreference = ‘SilentlyContinue’ and using the flag -ContentType “application/octet-stream” (more info is available here). Both should be good options, though the .NET client is preferred.

.NET client example: (New-Object System.Net.WebClient).DownloadFile($downloadsUri, $downloadPath)

Our tips and lessons learned here are based on the work that we’ve done with industry partners building out Citrix Workspace Appliance solutions for seamless turnkey integration with Citrix Cloud. (See this page for additional details.) Appliances in this program should be your top choice if you’re looking for proven, highly capable and scalable hybrid cloud.

Without further ado, here are the three main deployment strategies for the Citrix Cloud Connector:

Sysprep Approach

While provisioning your 2+ VMs to serve as the Cloud Connectors, chances are you’ll likely leverage Sysprep for this, which is why this approach is probably the preferred way to go. In a Sysprep XML answer file, download and install the Cloud Connector once the VM is provisioned. Here is a snippet of the command-line argument to kickoff the installation:

PSEXEC

This popular administrative tool will allow you to kick off a local CMD file to automate the installation in a remote manner. Here is an example:

Invoke-Command -ComputerName $Name -Credential $CredentialDomain -ScriptBlock {

param ($Name, $downloadsUri, $Customer, $ClientId, $ClientSecret, $SelectedRLID)

Write-Verbose "Downloading Citrix Cloud Connector installer for VM: $Name" -Verbose

Invoke-WebRequest -Uri $downloadsUri -OutFile "C:\cwcconnector.exe"

Write-Verbose "Running silent install of Citrix Cloud Connector for VM: $Name" -Verbose

Write-Verbose "C:\cwcconnector.exe /q /Customer:$Customer /ClientId:$ClientId /ClientSecret:$ClientSecret /ResourceLocationID:$SelectedRLID /AcceptTermsOfService:true" -Verbose

$a = "C:\cwcconnector.exe /q /Customer:" + $Customer + " /ClientId:" + $ClientId + " /ClientSecret:" + $ClientSecret + " /ResourceLocationID:" + $SelectedRLID + " /AcceptTermsOfService:true"

Out-File -filepath c:\ConnectorInstall.cmd -InputObject $a -Encoding asci

} -ArgumentList $Name, $downloadsUri, $Customer, $ClientId, $ClientSecret, $SelectedRLID

start-process "c:\psexec.exe" " /accepteula -s \\$Name c:\ConnectorInstall.cmd"

Local Execution with Automation Tools or Scheduled Task

Another approach is to use Chef, Puppet or other automation tools to kick off a silent installation locally. You can even use a regularly scheduled task to do this, such as:

schtasks /Create /ST 23:59 /SC once /ru "DOMAIN\Administrator" `
/rp "C1trix1" /TN "Install Connector"
/TR "C:\Users\Administrator.DOMAIN\Downloads\installconnector.bat"
schtasks /Run /TN "Install Connector"
schtasks /Delete /TN "Install Connector"

Additional Tips

Here are some additional tips to ensure a successful automated installation of the Cloud Connector.

  • Review the system requirements and command-line parameters. Note that a full GUI version of Windows Server is required. (Server Core is not supported at this time.)
  • The Cloud Connector needs to be run as admin. It cannot be installed by a system service.
  • Be careful of the switches used to invoke PowerShell, i.e. [‘-NoProfile’, ‘Non-Interactive’, ‘-Execution Policy’, ‘Unrestricted’, ‘-’].
  • Using Invoke-Command against a remote machine to kick off the silent install will fail, as named pipe ACLs DENY access to the NT AUTHORITY\NETWORK role, and that is what is used for PowerShell remoting:

Invoke-Command -ComputerName server01 -ScriptBlock {

C:\cwcconnector.exe /q /Customer:$Customer /ClientId:$ClientId /ClientSecret:$ClientSecret /Location:$SelectedRLID /AcceptTermsOfService:true }

That about wraps things up. We hope you found this post informative. Have you deployed the Citrix Cloud Connector in an automated fashion? Let us know the approach you took, then explain it in the comments field below. We welcome your feedback and questions.


Citrix TechBytes – Created by Citrix Experts, made for Citrix Technologists! Learn from passionate Citrix Experts and gain technical insights into the latest Citrix Technologies.

Click here for more TechBytes and subscribe.

Want specific TechBytes? Let us know! tech-content-feedback@citrix.com