unofficial PowerShell modules for Citrix Cloud DaaS. It works for Azure connected DaaS only.
For Japanese, see README-ja.md.
To use the cmdlets, you need to create an API client in Citrix Cloud.
Copy Citrix folder to $HOME\Documents\PowerShell\Modules folder.
That might be C:\Users\xxxxxxxx\OneDrive - xxxxxxxx\Documents\PowerShell\Modules folder if you're using OneDrive for Business.
I don't intend to publish this module to PowerShell Gallery, because it's unofficial.
$Env:CUSTOMER_ID = "xxxxxxxx"
$Env:CLIENT_ID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$Env:CLIENT_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxx"Then, you can run cmdlets.
The access token for Citrix Cloud API is implicitly acquired by the cmdlets, so you don't need to care about it.
Not all the cmdlets are implemented, and documented here.
To list all the cmdlets, run Get-Command -Module Citrix.
-
Get machine info.
$MachineName = "Ops2Machine-0001" Get-CitrixMachine -MachineName "${MachineName}.example.local"
-
Get session info on a machine
$MachineName = "Ops2Machine-0001" Get-CitrixMachineSession -MachineName "${MachineName}.example.local"
-
Get delivery group list
Get-CitrixDeliveryGroups
-
Get machine catalog list
Get-CitrixMachineCatalogs -
Get a machine catalog info
$CatalogName = "CVAD_APIs_MCS_Catalog" Get-CitrixMachineCatalog -CatalogName $CatalogName
-
Get machines in a machine catalog
$CatalogName = "CVAD_APIs_MCS_Catalog" Get-CitrixMachineCatalogMachines -CatalogName $CatalogName
-
Move a specified virtual machine to a different delivery group in a different machine catalog
.example.localis the domain suffix of the virtual machine.ORCHPERFS2is the NetBIOS domain name of the virtual machine.RG-CITRIX-DAASis the resource group name of the virtual machine.Citrix-Connectis the name of the hypervisor connection.# Define variables $DomainSuffix = "example.local" $NetBIOSDomainName = "ORCHPERFS2" $ResourceGroupName = "RG-CITRIX-DAAS" $PublishedName = "RemotePC" $UserName = "user01" $MachineName = "Ops2Machine-0001" $CurrentMachineCatalogName = "CVAD_APIs_MCS_Catalog01" $NewMachineCatalogName = "CVAD_APIs_MCS_Catalog02" $CurrentDeliveryGroupName = "CVAD_APIs_DG_Group01" $NewDeliveryGroupName = "CVAD_APIs_DG_Group02" # Remove the machine from the current delivery group $Machine = Get-CitrixMachine -MachineName "${MachineName}.${DomainSuffix}" Remove-CitrixDeliveryGroupMachine -DeliveryGroupName $CurrentDeliveryGroupName -MachineName $Machine.Id # Move the machine to from the current machine catalog Remove-CitrixMachineCatalogMachine -MachineCatalogName $CurrentMachineCatalogName -MachineName "${MachineName}.${DomainSuffix}" # Add the machine to the new machine catalog Add-CitrixMachineCatalogMachine -MachineCatalogName $NewMachineCatalogName -MachineName "${NetBIOSDomainName}\${MachineName}" -HypervisorConnection 'Citrix-Connect' -HostedMachineId "${ResourceGroupName}/${MachineName}" # Add the machine to the new delivery group Add-CitrixDeliveryGroupMachine -DeliveryGroupName $NewDeliveryGroupName -MachineName "${MachineName}.${DomainSuffix}" -MachineCatalogName $NewMachineCatalogName # Change the published name of the machine Update-CitrixMachineCatalogMachine -MachineName "${MachineName}.${DomainSuffix}" -AssignedUsers "${NetBIOSDomainName}\${UserName}" -HostedMachineId "${ResourceGroupName}/${MachineName}" -HypervisorConnection 'Citrix-Connect' -PublishedName $PublishedName