Category filter

Script to configure interactive logon message on Windows

An interactive logon message specifies a text message shown to the user when they sign in. It can be used as a security measure by organizations to warn/notify users about anything. These banners typically contain legal notices or disclaimers that inform users about appropriate system usage and privacy expectations. By agreeing to the terms and conditions presented in the logon messages, users acknowledge that they understand and accept the information presented in the banner before proceeding to log in. By configuring the Group Policy Objects (GPOs) on Windows devices, an interactive logon message can be set to display before user login. IT administrators can deploy the following script to set an interactive logon message on a fleet of Windows devices using Hexnode’s Execute Custom Script remote action.


The sample script provided below is adapted from a third-party open-source site.

PowerShell script

The following PowerShell script helps to configure Windows registry keys to set an interactive logon message on Windows devices.

Before deploying the script, write the information to be displayed in place of “Enter your text here” in the script. You can also set up a title for your instructions by replacing “Enter a Title for the text” in the script.

The script uses the Set-ItemProperty cmdlet of PowerShell to edit policies in the Windows registry related to the interactive logon message. It modifies the values of the ‘legalnoticetext’ and ‘legalnoticecaption’ registry keys located at ‘HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System’.

These registry keys are responsible for setting up an interactive message on the login window, which will be displayed to users when they attempt to log on to the Windows device.

What happens at the device end?

Deploying the above script will display an interactive message to all users when logging in to the device. Users must click ‘OK’ before proceeding to log in to the device.
An interactive logon message before login screen displayed on Windows devices


  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository