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.
Steps to create a GPO and link it to a Domain
- On the Windows domain controller, open Group Policy Management and create a GPO under the domain.
- Right-click on the GPO, select Edit to open the Group Policy Management Editor.
-
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.
-
Switch to the PowerShell Scripts tab, and click Add….
-
Click Browse… on the right of ‘Script Name’ field, a file browser pops up, located in the NetLogon folder by default.
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. (Please use the one provided by Citrix as part of the installation file).
-
Select Run Windows PowerShell scripts last and click OK or Apply.