• View Communities
    • Citrix Developer Network
      The place for unfiltered straight talk on Citrix products. Blogs, code downloads, best practices, APIs, and more can all be found here.
    • Citrix Ready Community Verified
      Does it work with Citrix? Application compatibility questions are a thing of the past with the new Citrix Community Verified site.
    • Blogs
      Learn the latest from the Citrix employees who are building application delivery infrastructure technologies.
    • Blogosphere
      The Citrix Blogosphere is a window into the thousands of conversations taking place about Citrix and Application Delivery.
  •  Sign In
XenDesktop Developer Network

Adding a virtual desktop to an existing VM-based desktop group

This command adds a new virtual desktop, hosted by a VM, to an existing VM-based desktop group.   Before adding a VM to the group, you must create a mapping between the VMs host ID and Active Directory ID. To do this, run the Get-XdHostedMachine cmdlet to obtain a list of host IDs for VMs and assign Active Directory IDs to those VMs.

# get all the groups whose name starts with 'test' (should be just one)
$grp = Get-XdDesktopGroup test*
# get all the workers whose friendly names have 'machine3' in them (should be just one)
$dsk= Get-XdHostedMachine $grp.HostingSettings.HostingServer -name *machine3*
# Set up the mapping to the AD name for the new Virtual Desktop machine
$dsk.Name = 'machine3'
$grp.Desktops.Add($dsk)
Set-XdDesktopGroup $grp

If host ID to Active Directory ID mappings have been created previously, run the following command:

Get-XdDesktopGroup test* | %{ [void]$_.Desktops.Add
($(Get-XdHostedMachine $_.HostingSettings.HostingServer -name *machine3*)); $_ } |
Set-XdDesktopGroup

Tags

vdi vdi Delete
xendesktop powershell api xendesktop powershell api Delete
xendesktop sdk xendesktop sdk Delete
Enter tags to add to this page:
Please wait 
Looking for a tag? Just start typing.
Related Links