AD Server - Logon Script Configuration

The Logon script is used by the Virtual Delivery Agent (VDA) to disconnect the pre-launch session after the Session Remote Start initiated logon completes. This script is applied to all VDAs and users using Group Policy to ensure that no resources remain active and unused. It allows users to reconnect later through their regular login method, ensuring efficient resource management and a seamless user experience.

  1. On the Windows domain controller, open Group Policy Management and create a GPO under the domain or on the Citrix VDAs OU.

    Create a GPO

  2. Right-click on the GPO, select Edit to open the Group Policy Management Editor.

    Edit a GPO

  3. In the Group Policy Management Editor, expand User Configuration > Policies > Windows Settings > Scripts (Logon/Logoff). Right-click Logon on in the right panel and select Properties.

    Logon properties

  4. Switch to the PowerShell Scripts tab, and click Add….

    Add PowerShell scripts

  5. Click Browse… on the right of the Script Name field, a file browser pops up, located in the NetLogon folder by default.

    Netlogon folder

    The Logon folder is a shared folder which typically has read-only and execute permissions by machines and users. To avoid permission issues, it is recommended not to use any other folder.

    Create DisconnectSession.ps1 under this folder.

    Note:

    Use the one provided by Citrix as part of the installation file.

    DisconnectSession

  6. Select Run Windows PowerShell scripts last and click OK or Apply.

    Run Windows PowerShell Scripts last

AD Server - Logon Script Configuration