Citrix Provisioning

使用 API PowerShell 命令在不可信域中预配目标设备

可以使用 Citrix Provisioning API PowerShell 命令在不可信域中预配目标设备。将参数 DomainCredentials 添加到预配命令 Start-PvsProvisionMachinesStart-PvsProvisionXdMachines 中。

详细步骤如下所示:

  1. 导入 Citrix Provisioning API PowerShell 模块。

    Import-Module "C:\Program Files\Citrix\Provisioning Services\Citrix.ProvisioningServices.dll"
  2. 建立与 Citrix Provisioning API 服务器的连接。

    Set-PvsApiConnection -PvsServerAddress <server.domain> -PvsServerPort 54324 ` -Domain <domain> -Username <username> -Password <password>
  3. 输入用于在不可信域中创建计算机帐户的凭据。

    $targetDeviceDomainCredentials = Get-Credential
  4. 运行带 DomainCredentials 参数的 Start-PvsProvisionXdMachinesStart-PvsProvisionMachines 以预配目标设备。

    注意:

    如果要在指定的 XenDesktop 计算机目录中为 XenDesktop 预配 VM,请运行 Start-PvsProvisionXdMachines

    • 预配 XenDesktop 计算机:示例:

      $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
    • 预配 VM:

      $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. 重复查询预配状态,直到预配任务完成。

    Get-PvsProvisioningStatus -ProvisionMachinesConnectionId $provisionMachinesId

    在不可信域中完成目标设备的预配后,您将获得以下输出:

    Cancelled : False CurrentVmPercentComplete : 100 ErrorOccurred : False Message : Machine Provisioning Complete! OverallPercentComplete : 100
使用 API PowerShell 命令在不可信域中预配目标设备