Provision target devices in untrusted domain using API PowerShell commands

Last published : Oct 20, 2026
You can provision target devices in an untrusted domain using Citrix Provisioning™ API PowerShell commands. Add the parameter DomainCredentials to the provisioning commands Start-PvsProvisionMachines and Start-PvsProvisionXdMachines.
The detailed steps are as follows:
  1. Import Citrix Provisioning API PowerShell module.
    Import-Module "C:\Program Files\Citrix\Provisioning Services\Citrix.ProvisioningServices.dll"
  2. Establish a connection to the Citrix Provisioning API server.
    Set-PvsApiConnection -PvsServerAddress <server.domain> -PvsServerPort 54324 `
    -Domain <domain> -Username <username>
    -Password <password>
  3. Input the credentials to create machine accounts in the untrusted domain.
    $targetDeviceDomainCredentials = Get-Credential
  4. Run Start-PvsProvisionXdMachines or Start-PvsProvisionMachines with the DomainCredentials parameter to provision target devices.
    Note:
    Run Start-PvsProvisionXdMachines if you want to provision VMs for XenDesktop® in the specified XenDesktop machine catalog.
    • Provision XenDesktop machines: Example:
      $provisionMachinesId = Start-PvsProvisionXdMachines `
      -DdcAddress <your-ddc-address>`
      -BootType <your-boot-type> `
      -CatalogName <your-catalog-name> `
      -CatalogDescription <your-catalog-description> `
      -SessionSupport <your-session-support> `
      -AllocationType <your-allocation-type> `
      -PersistUserChanges <your-persist-user-changes> `
      -Scope <your-scope>`
      -VdaLevel <your-vda-level> `
      -XenDesktopHostResource <your-xd-host-resource> `
      -HostResourcePassword <your-host-resource-passsword> `
      -TemplateName <your-template-name> `
      -NetworkPath <your-network-path> `
      -StoreId <your-store-id> `
      -SiteId <your-site-id> `
      -DiskLocatorId <your-disk-locator-id>`
      -Domain <target-device-domain> `
      -OrganizationalUnit <target-device-ou> `
      -NamingScheme <your-naming-scheme> `
      -VmCount <vm-count> `
      -DeviceMemory <device-memory-size> `
      -DeviceCpu <device-cpu-count> `
      -DeviceWriteCacheSize <device-write-cache-size> `
      -NameSuffixType <your-name-suffix-type> `
      -CitrixCloud: <is-Citrix-Cloud> `
      -DomainCredentials $targetDeviceDomainCredentials
    • Provision VMs:
      $provisionMachinesId = Start-PvsProvisionMachines `
      -HostType <your-host-type> `
      -HostAddress <your-host-address> `
      -HostUsername <your-host-user-name> `
      -HostPassword <your-host-password> `
      -TemplateName <your-template-name> `
      -StoreId <your-PVS-store-id> `
      -SiteId <your-PVS-site-id> `
      -CollectionId <your-collection-id> `
      -DiskLocatorId <your-disk-locator-id> `
      -Domain <target-device-domain> `
      -OrganizationalUnit <target-device-ou>`
      -NamingScheme <your-naming-scheme> `
      -VmCount <vm-count> `
      -DeviceMemory <device-memory-size> `
      -DeviceCpu <device-cpu-count> `
      -NameSuffixType <your-name-suffix-type> `
      -DomainCredentials $targetDeviceDomainCredentials
  5. Query the provisioning status repeatedly until the provisioning job is complete.
    Get-PvsProvisioningStatus -ProvisionMachinesConnectionId $provisionMachinesId
    When provisioning of target devices in an untrusted domain is complete, you get the following output:
    Cancelled : False
    CurrentVmPercentComplete : 100
    ErrorOccurred : False
    Message : Machine Provisioning Complete!
    OverallPercentComplete : 100