This will be first in a series of posts relating to what I found in moving to Citrix Cloud and some of the gotchas I encountered.
Update** Added change to switch profiles to: Get-XDAuthentication -ProfileName “Cloud-Test” -Verbose**
This was a good article to get started with using the Cloud SDK to replace your other SDK you installed with Citrix Studio (https://www.citrix.com/blogs/2022/02/03/getting-started-with-powershell-automation-for-citrix-cloud/). Important note, if you install this with Studio installed, Studio will no worky after the installation.
One of the other things you will have to do, is create an API access account that will download a secureclient.csv that you will use to authenticate and allow you to run commands against Citrix Cloud.
Logon to the Citrix Cloud at cloud.com and get authenticated.
Click on the hamburger menu in the upper left.
Click on “Identity and Access Management.”
Click on “API Access.”
Fill out the name and click “Create Client.”
Copy and save the “ID” and “Secret.”
Click to download and save the “secureclient.csv” file to store in a safe location.
I added the “CustomerId” field to my secureclient file to pass to the XDCredential setup. To get this, you can see your CCID on the upper-right hand side underneath your name while you are logged into Citrix Cloud.
Below is what I used to configure my access to do the connections. One thing I noticed, if you name the profile anything other than “default,” it prompts for authentication and caused issues for automated scheduled tasks.
# Script to setup Citrix Cloud credential profile asnp Citrix* $secureClientProd = “C:\scripts\logs\secureclient-1.csv" $secureClientTest = “C:\scripts\logs\secureclient-2.csv" $xdCredsProd = import-csv $secureClientProd $xdCredsTest = import-csv $secureClientTest # Set prod profile Set-XDCredentials -CustomerId $xdCredsProd.CustomerId -SecureClientFile $secureClientProd -ProfileType CloudAPI –StoreAs "default" # Set test profile if you have a test cloud account Set-XDCredentials -CustomerId $xdCredsTest.CustomerId -SecureClientFile $secureClientTest -ProfileType CloudAPI –StoreAs "Cloud-Test" # List profiles Get-XDCredentials -ListProfile # Load credentials Get-XDCredentials -ProfileName "default" # To change profile credentials Get-XDAuthentication -ProfileName "Cloud-Test" # Clear Cloud credentials if you wish to delete a profile Clear-XDCredentials -ProfileName "profilename"
So what I did to modify most of the scripts I was using before, was to remove the -AdminAddress and add these lines to the top of the scripts, then proceed business as normal. This allowed me to do the same things I was doing before and pass the API securecred file information.
asnp Citrix* Get-XDCredentials -ProfileName "default"
Links to other articles in the series:
Part 2 Of Cloud Migration Series: Part 2
Part 3 Of Cloud Migration Series: Part 3
Part 4 Of Cloud Migration Series: Part 4