---
sourceDocument: Australia IT Service Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/it-service-management

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia IT Service Management

ft:clusterId :

    - itsm

bundleId :

    - itsm

workflow :

    - Technology


---

# Manage logon and logoff scripts

# Manage logon and logoff scripts for non-persistent VDIs {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
Configure logon and logoff scripts in a non-persistent VDI pool to control how the MID Server starts and stops during virtual desktop sessions.

## Before you begin

Complete the following tasks before you prepare the golden image:

* [Install Agent Client Collector on a non-persistent VDI reference device](https://servicenow-prod.fluidtopics.net/uI~OcdrFJMYQtBZ~s7Xt8A "Install Agent Client Collector (ACC) on the reference device used to create the non-persistent VDI golden image. The mid-less installation method, combined with the LOCALUSERNAME=\"SYSTEM\" parameter and a non-persistent setting in acc.yml, configures the agent to operate correctly across copied VDI sessions.")
* [Enable DEX browser extension](https://servicenow-prod.fluidtopics.net/gInyzpRs4jIn~~IxAoU_ew "Activate the DEX Chrome or Edge Extension on your system to collect different operational or performance-based metrics for the web applications.")
* [Prepare non-persistent VDI reference device](https://servicenow-prod.fluidtopics.net/DZPhr4E2~9Xk9rbcBq3dzQ "Remove the registration certificate, agent identifier, cached databases, and logs from the reference device before sealing it as a golden image. This cleanup confirms that each VDI duplicated from the image registers with a unique identity on first start.")
{#configure-np-vdis__ul_prereq_prepare_np_vdi}

Role required: sn-dex-admin

## Procedure

1. Configure your persistent storage to be accessible from all VDIs in the pool, and verify that the VDIs have read and write access to the certificate storage location.  
   This storage backs up and restores VDI certificates across sessions. It must remain accessible throughout the VDI lifecycle.
2. Place the logon script in your VDI management tool's session-start or post-synchronization script configuration, and place the logoff script in the session-end or power-off script configuration.  
   The logon script runs at the start of each session to restore the certificate from your persistent storage to the VDI. The logoff script runs at the end of each session to push any remaining metrics to the ServiceNow instance before the session disconnects.

   For more information, see [Non-persistent VDI parameters, scripts, and settings](https://servicenow-prod.fluidtopics.net/4uYTEf3iPso~kWA1vK2LWw "Find the Agent Client Collector mid-less installation command syntax, logon and logoff script file names and locations, and an installation command example when setting up a non-persistent VDI golden image.").
3. Depending on the tool your organization uses for authentication, modify the authentication steps in the logon and logoff scripts to connect to your persistent storage location.
4. Create the golden image from the reference device and configure the VDI pool to use it.

