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.
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:
- Download the installer: https://download.apps.cloud.com/CitrixPoshSdk.exe.
- Run the command
CitrixPoshSdk.exe EnvironmentName=USGovernment. This command enables the SDK to run in the context of Citrix Cloud Government by default.
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:
- From the Windows feature for removing or changing programs, select Citrix Virtual Apps and Desktops Remote PowerShell SDK.
- Right-click and select Uninstall.
- Follow the dialog.
To run the Remote PowerShell SDK
Run the Remote PowerShell SDK on a domain-joined computer within that resource location:
- Open a PowerShell command prompt. You do not need to run as an administrator.
- Add the Citrix snap-ins:
- 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 USGovernmentto authenticate to Citrix Cloud Government.
- 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.
- 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.