XenDesktop Active Directory Name Caching Explained

XenDesktop Active Directory Name Caching Explained

book

Article ID: CTX219694

calendar_today

Updated On:

Description

XenDesktop 5.x had provided a registry DesktopServer\NameCache\NameRefreshPeriodMins to tune default Active Directory (AD) name cache refresh period.
CTX126704 - Registry Entries Used by XenDesktop 5.x Broker Service
The registry is still available for XenDesktop 7.x with minimum setting = 5 min
CTX138738 - Registry Key Entries Used by XenDesktop 7.x

To achieve a  quick query of AD Machine & User name related to XenDesktop Site, Citrix Broker Service is designed to cache these name info in XenDesktop Database, specifically:

Tablechb_State.Controllers stores Delivery Controller SAM name and DNS Name
Tablechb_State.AccountNames stores AD User account SAM name, User Principal Name (UPN) and Common Name (CN)
Tablechb_State.WorkerNames stores AD Machine SAM name and DNS Name

By Default, Citrix Broker Service will synchronize Machine & User name changes with Active Directory every 24 hours and then refresh Name Cache in Database.

It can be monitored through CDF trace:
**********************
15:48:13:05827,1992,2300,0,***,***,***,***,***,CDF_NET_INFO,"ControllerNameCache: start refresh...",""
15:48:13:09241,1992,2300,0,***,***,***,***,***,CDF_NET_INFO,"ControllerNameCache: refresh complete, 1 entries updated",""
15:48:34:43042,6540,2300,0,***,***,***,***,***,CDF_NET_INFO,"WorkerNameCache: start refresh...",""
15:48:34:50038,6540,2300,0,***,***,***,***,***,CDF_NET_INFO,"WorkerNameCache: refresh complete, 7 entries updated",""
15:48:39:73442,4400,2300,0,***,***,***,***,***,CDF_NET_INFO,"AccountNameCache: start refresh...",""
15:48:39:73565,4400,2300,0,***,***,***,***,***,CDF_NET_INFO,"AccountNameCache: refresh complete, 0 entries updated",""
*************************

Under the hood, three Store Procedures chb_state.UpdateControllerNames(), chb_State.UpdateAccountNamesBySid() and chb_State.UpdateWorkerNames() will apply the new data to above 3 tables respectively.

XenDesktop PowerShell provides a way to refresh Name Cache immediately for AD Machine and User name changes:
> asnp citrix*
> Update-BrokerNameCache –Machines
> Update-BrokerNameCache -Users

Example

  1. Suppose we got a desktop assigned with an AD user named Ctx\NameCache.

  2. Change Ctx\NameCache login name to NameCache_new from AD.

     User-added image

  3. Refresh Delivery Group page, User name won’t change until next Name cache refresh period comes.

  4. Run Update-BrokerNameCache –users to manually refresh the name cache.

    User-added image

  5. Refresh Delivery Group page, new login username is refreshed immediately.

Issue/Introduction

The article gives a brief explanation of XenDesktop Active Directory Name Caching.