SDKs

The Citrix Virtual Apps and Desktops Remote PowerShell SDK automates complex and repetitive tasks. It provides the mechanism to set up and manage the Citrix Virtual Apps and Desktops (formerly XenApp and XenDesktop) environment without having to use the Studio user interface.

Requirements

Ensure PowerShell 3.0 or later is available on the machine.

Install or remove the Remote PowerShell SDK

To install the Remote PowerShell SDK for use with Citrix Cloud Government:

  1. Download the installer: https://download.apps.cloud.com/CitrixPoshSdk.exe. The package contains both x86 and x64 implementations.
  2. Run the command CitrixPoshSdk.exe EnvironmentName=USGovernment. This command enables the SDK to run in the context of Citrix Cloud Government by default.

    Note:

    Alternatively, you can run the SDK installer and follow the dialogs to complete the installation. However, you will need to specify the Citrix Cloud Government environment when you authenticate using the Get-XdAuthentication cmdlet. See To run the Remote PowerShell SDK in this article.

Installation logs are created in %TEMP%\CitrixLogs\CitrixPoshSdk. Logs can help resolve installation issues.

To uninstall the Remote PowerShell SDK:

  1. From the Windows feature for removing or changing programs, select Citrix Virtual Apps and Desktops Remote PowerShell SDK.
  2. Right-click and select Uninstall.
  3. Follow the dialog.

To run the Remote PowerShell SDK

Run the Remote PowerShell SDK on a domain-joined computer within that resource location:

  1. Open a PowerShell command prompt. You do not need to run as an administrator.
  2. Add the Citrix snapins: asnp citrix.*
  3. You can explicitly authenticate by running the command Get-XdAuthentication. Alternatively, you can execute your first Remote PowerShell SDK command, which will prompt you for the same authentication as Get-XdAuthentication. However, if you did not install the SDK as described in Install or remove the Remote PowerShell SDK earlier in this article, you must use the command Get-XdAuthentication -EnvironmentName USGovernment to authenticate to Citrix Cloud Government.
  4. Continue executing PS SDK cmdlets or PS SDK automation scripts. For an example script, see Example activities in the Virtual Apps and Desktops service documentation.

Notes:

  • Once authenticated, remote access remains valid in the current PowerShell session for 24 hours. After this time, you must enter your credentials.
  • The Set-XdCredentials cmdlet cannot be used with Citrix Cloud Government to define credentials. Only the Get-XdAuthentication cmdlet is supported with Citrix Cloud Government.
  • Citrix recommends that you do not run this SDK’s cmdlets on Cloud Connectors. The SDK’s operation does not involve the Cloud Connectors.

For a complete list of supported and disabled snap-ins, see Limitations in the Virtual Apps and Desktops service documentation.