How to Configure XenDesktop for a Teaching Lab or Classroom Environment

How to Configure XenDesktop for a Teaching Lab or Classroom Environment

book

Article ID: CTX128232

calendar_today

Updated On:

Description

This article describes how to configure XenDesktop to deliver desktops in a teaching lab or classroom environment.

Background

The typical requirement in a teaching lab is for a group of users to be able to log on concurrently to multiple thin clients using the same user name and password and for each to receive their own desktop.

While XenDesktop allows the user account concurrent access to multiple desktops within a group, this does not meet the preceding requirement because when the user logs on to the client, multiple desktops are presented from which the user must reliably select ‘their’ desktop (rather than taking an already in-use desktop of another user). In addition, this defeats automatic logon processing that requires only a single desktop to be available.

XenDesktop offers a solution to this issueby allowing a desktop to be permanently assigned to a client IP address or NetBIOS name. Using this approach, each client device in the teaching lab can be assigned a specific desktop within the XenDesktop site. This allows each client to see a single fixed desktop, and each to be used independently by users who log on with the same credentials.

Note: You MUST use the Desktop Appliance Lock in order for the NetBIOS name to be returned to XenDesktop. If you do not use the Desktop Appliance Lock, the NetBIOS name will not be returned, so allocation of machines to NetBIOS names will not function as expected.

Instructions

Note: For XenDesktop 7.x Preparation - Steps 1, 2, and 4 should be as per the existing CTX article. Step 3 is specific to XenDesktop 7.x

  1. Create private group.

  2. Add machine(s) to group.

  3. Set policies for XenDesktop 7.x with the PowerShell cmdlets:

    Get-BrokerDesktopGroup …

    Get-BrokerAccessPolicyRule –DesktopGroupUid <uid> | Set-BrokerAccessPolicyRule –AllowedUsers AnyAuthenticated

    Get-BrokerAssignmentPolicyRule –DesktopGroupUid <uid> | Set-BrokerAssignmentPolicyRule –Enabled $false

  1. Use Set-BrokerPrivateDesktop to do IP assignment(s).

    Assigning a desktop to a specific client IP address or NetBIOS name cannot be performed entirely through Desktop Studio. However, Citrix recommends you to use Desktop Studio for bulk configuration as described in the following sections. This ensures that Desktop Studio is able to manage the machines after they have been configured.

Preparation using Desktop Studio

  1. From the Machines node of Desktop Studio, create a new Catalog for the machines to be used to provide desktops in the lab. The type of the catalog must be one that permanently allocates machines to the users (even though this will not occur here). Which specific catalog type is used depends on your virtual machine power and image management requirements; however Pooled-Static or Dedicated catalogs are likely to be typical choices.

  2. Add the required machines to the new catalog; do not assign any users to the machines.

  3. From the Assignments node of Desktop Studio, create a new Desktop Group and add the machines from the new catalog to it. On the Select users page of the dialog, do not add any users. Instead, click Next.

Assigning Desktops using the SDK

After the required Desktop Group has been created using Desktop Studio, use the XenDesktop Software Development Kit (SDK) to actually assign the desktops to client devices in the lab.
  1. On a computer with the XenDesktop Broker SDK Snap-in registered (for example, the machine running Desktop Studio), open a PowerShell window and enter Add-PSSnapin Citrix.Broker.Admin.*

    Note: Processing now depends on whether the desktops are to be assigned to client IP addresses or NetBIOS names.

  2. To assign a Desktop to a Client IP Address, run the following SDK command, providing the required desktop name and the IP address of the client device to which it is being assigned:

    Set-BrokerPrivateDesktop DOMAIN\MACHINE_A -AssignedIPAddress 10.11.132.7

    In the preceding example, anyone who logs on using the client device with IP address 10.11.132.7 now always receives the desktop named ‘DOMAIN\MACHINE_A’.

  3. To assign a Desktop to a Client DNS Name, run the following SDK command, providing the required desktop name and the DNS name of the client device to which it is being assigned:

    Set-BrokerPrivateDesktop DOMAIN\MACHINE_B -AssignedClientName client_b

    In the preceding example, anyone who logs on using the client device with NetBIOS name ‘client_b’ now always receives the desktop named ‘DOMAIN\MACHINE_B’.

    Note: Assigning desktops to a client NetBIOS name only functions correctly if the client device reports its true NetBIOS name to the XenDesktop broker service. Whether the correct NetBIOS name is supplied is a function of the client device/software in use; however:

  • Using a re-purposed client PC with the Desktop Appliance Lock installed does provide the correct NetBIOS name.

  • Using a Web browser to access Web Interface does not provide the correct NetBIOS name.

    Note: The Broker Service performs a string comparison against the AssignedIPAddress/AssignedClientName entries for the desktop group to compare it to what the client machine is reporting the IP address/client name to be. Should you experience issues with the feature not working – you should enable CDF tracing for BrokerDAL component using CDFControl tool ( http://support.citrix.com/article/CTX111961 ) and look for entries similar to:

    20/05/11 12:59:32.0110 : BrokerDAL:DAL >>> EnumerateResources(UserSid=S-1-5-21-3430261252-2596645165-1205625234-4242, 8 GroupSids, 0 DenyOnlySids, IP=10.20.30.40, Name=WINXP-CLIENT, ViaAG=False, GetIconHash=False, GetIconData=False)

    20/05/11 12:59:32.0240 : BrokerDAL:DAL <<< EnumerateResources(UserSid=S-1-5-21-3430261252-2596645165-1205625234-4242): 1 resources

    It is the two entries in bold (IP= and Name=) that are compared to what is stored in the AssignedIPAddress and AssignedClientName properties of the Desktop Group. Should a match be found, the <<< EnumerateResources line will end with 1 resources.

    For example: If a match is not found, you typically see this returning as 0 resources.

To Verify Client Assignments

The assignments of machines within the lab desktop group can be verified using the output of the following SDK command (this must be entered on a single line). Here, <GroupName> is the Desktop Group Name value of the Desktop Group created in Desktop Studio:

Get-BrokerDesktop –DesktopGroupName <GroupName> | ft -auto MachineName,AssignedIPAddress,AssignedClientName

Immediately after creation of a new Catalog and Desktop Group, the preceding command shows output of the following form:

 MachineName     AssignedIPAddress AssignedClientName
 -----------     ----------------- ------------------
 DOMAIN\MACHINE1
 DOMAIN\MACHINE2
 
Following assignment of desktops to client IP addresses, output might appear as:
 
 MachineName     AssignedIPAddress AssignedClientName
 -----------     ----------------- ------------------
 DOMAIN\MACHINE1 10.20.32.14
 DOMAIN\MACHINE2 10.20.32.16

Or, following assignment of desktops to client NetBIOS names, output might appear as:

 MachineName     AssignedIPAddress AssignedClientName
      ----------------- ------------------
 DOMAIN\MACHINE1                   client_1
 DOMAIN\MACHINE2                   client_2

A desktop can only be assigned to a user, a client IP address, or a client NetBIOS name; it cannot be assigned to more than one of these at the same time.

To Clear Client Assignments

Use one of the following commands as appropriate to remove a client IP address or NetBIOS name assignment from a desktop:

Set-BrokerPrivateDesktop DOMAIN\MACHINE1 –AssignedIPAddress $null

Set-BrokerPrivateDesktop DOMAIN\MACHINE2 –AssignedClientName $null

Because Desktop Studio is used to create both the Catalog and the Desktop Group, either can subsequently be deleted safely using Desktop Studio if required.

Other Notes

You must ensure that the user account used for logons to client devices in the lab is not granted access to any other desktops using user assignment (or user group membership) otherwise, the clients are presented with multiple desktops when the user attempts to log on, which prevents the assignment scheme from working as desired.

Because Desktop Studio does not itself support assignment to IP address or NetBIOS name, it typically shows desktops configured in this way as unavailable, but at the same time, as not having an assigned user. However, actual user sessions appear correctly, and session management functionality works.
 

Environment

The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.

Issue/Introduction

This article describes how to assign desktops to client IP addresses or NetBIOS names.