Configure Logon script for AD server

The Logon script is used by the VDA to disconnect the pre-launch session after the Session Remote Start initiated logon completes. We use Group Policy to apply the script to all VDAs and users.

  1. On the Windows domain controller, open Group Policy Management and create a GPO under the domain.

Create a GPO

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

Edit a GPO

  1. 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

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

    Add PowerShell scripts

  3. Click Browse… on the right of ‘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.

  1. Create DisconnectSession.ps1 under this folder. (Please use the one provided by Citrix as part of the installation file).

    DisconnectSession

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

    Run Windows PowerShell Scripts last

Configure Logon script for AD server