Force enrollment using logon script

The Force enrollment using a login script feature, when enabled, will force unenrolled users logging into their Windows desktop to complete enrolling for the authenticators enabled for them in ADSelfService Plus.

Forcing enrollment via the login script in ADSelfService Plus

You can achieve this by configuring schedulers to force unenrolled users to complete enrollment. These schedulers will periodically scan your AD for unenrolled users and associate their accounts with a logon script. This script will prompt users to enroll whenever they log in to their machines.

Here's how it works:

  1. Log in to the ADSelfService Plus web console with admin credentials.  
  2. Navigate to Configuration > Administrative Tools > Quick Enrollment and click Force Enrollment using Logon Script.
  3. Enter a Scheduler Name and Description.
  4. Select the policy that applies to the users for whom you want to force enrollment.
  5. Enter the name you want to be displayed for the Window, in the Window Title field.
  6. Enter the message to be displayed to the users regarding mandatory enrollment, in the Window Content field.
  7. Enter the text for the click-to-action button in the Enroll Button field.
  8. Leave the Cancellation Button unchecked if you want to force users to enroll when they log in to their machine. If cancellation is enabled, users can close the logon script and access their machine without completing the enrollment process. However, they will be prompted to enroll when they log in to ADSelfService Plus. If you want to give your users the option to skip enrollment, enable the Cancellation Button option and customize the click-to-action text accordingly.
  9. Important: If the user account logging into the Windows machine has been blocked in ADSelfService Plus, the force enrollment window will not be shown to them. They will be prompted to enroll when their account is unblocked and they log in to ADSelfService Plus.
  10. Schedule the frequency to which force enrollment logon script automatically applies to newly added Active Directory users
  11. Click Save
    logonscript
Important:
  1. By default, the logon script file (the default location is <C:\Program Files\ManageEngine\ADSelfService Plus\bin ADSelfService_Enroll.hta) will be placed in the SYSVOL folder when forced enrollment is enabled.
  2. ADSelfService Plus will stop showing the force enrollment alert during login once users finish the enrollment process.
  3. The user account configured in ADSelfService Plus' Domain Settings should have read/write permission over the script path and the permission to copy the script file to the SYSVOL folder in the domain controller. If the required permissions are not granted or there's an issue that prevents the script file from being copied to the SYSVOL folder, make sure you manually copy and paste the script file to the SYSVOL folder.

ADSelfService Plus allows you to enforce enrollment only for a particular set of users instead of enforcing it for all users in a self-service policy. All you need to do is manually add an entry in the ADSelfService_Enroll.hta file and then configure the logon script to a particular OU through Group Policy. This will enforce the enrollment only for those users who are within the specified OU.

Steps to be followed in ADSelfService Plus

  1. Navigate to the <ADSelfService Plus_Installation_Dir>\bin folder (the default location is <C:\Program Files\ManageEngine\ADSelfService Plus\bin) and locate the ADSelfService_Enroll.hta script file.
  2. Open the file in a text editor and locate the property postData.
  3. Add &manualScript=true at the end of the code as shown below:
    postData= "user=" + objNetwork, UserName + "&domainFlatName=" + objNetwork.UserDomain + "&domainDNSName=" +strdns + "&manualScript=true"
  4. To allow users to close the enrollment request pop-up displayed in their login screen, append &forceEnroll=false to the manualScript tag as shown below:
    postData = "user=" + objNetwork.UserName + "&domainFlatName=" + strdns + "&manualScript=true&forceEnroll=false".

Save the file and apply the script to users through group policies.

Configure the logon script to a particular OU through group policy

  1. Open Server Manager and go to Tools > Group Policy Management.
  2. Expand the Domains tree, right-click the desired domain or OU, and select Create a GPO in this domain and Link it here.
  3. The New GPO dialog box is displayed. Enter a Name for the GPO and click OK.
  4. enrollmentReminder
  5. Find the newly created GPO under the domain or OU that you created in the above step, right-click it, and select Edit.
  6. enrollmentReminder
  7. In the Group Policy Management Editor that opens, go to User Configuration > Policies > Windows Settings > Scripts (Logon/Logoff), then double-click on Logon displayed on the right pane.
  8. enrollmentReminder
  9. In the Logon Properties window that opens, click Show Files. A folder whose name ends in User\Scripts\Logon\ is displayed.
  10. enrollmentReminder
  11. Copy your logon script, in our case, ADSelfService_Enroll.hta file from <Install Directory>\bin (the default location is <C:\Program Files\ManageEngine\ADSelfService Plus\bin), and paste it here.
  12. Click Add in the Logon Properties window.
  13. Click Browse to open the logon script directory, select your logon script file and click OK.
  14. Ensure that your selected logon script file is displayed in the Logon Properties window. Click OK.

Now, enrollment will be enforced during login for users who belong to the desired OU.

Steps to follow if you are you already using a logon script

The force enrollment logon script that comes bundled with ADSelfService Plus is compatible with any type of logon script that you may already be running in your Windows environment. 

If you’re already using a logon script, follow the steps given below: 

  1. If the logon script is a batch file, add the following line at the end of your logon script: path = "<ScriptPath>" start /d %path% ADSelfService_Enroll.hta
  2. If the logon script is a VB script, add the following lines at the end of your logon script: Set objShell = WScript.CreateObject ("WScript.Shell") path = "<ScriptPath>" objShell.Run(path+"\"+"ADSelfService_Enroll.hta") Set objShell = nothing
  3. Important: Replace <ScriptPath> with the location of the ADSelfService_Enroll.hta file (the default location is <C:\Program Files\ManageEngine\ADSelfService Plus\bin).

    Tip:

     Enable single sign-on via NTLMv2 authentication to allow users to log in to ADSelfService Plus automatically when they click on the Enroll button.

Here’s a demo video that takes you step by step through configuring forced enrollment.

Your request has been submitted to the ADSelfService Plus technical support team. Our technical support people will assist you at the earliest.

 

Need technical assistance?

  • Enter your email ID
  • Talk to experts
  •  
     
  •  
  • By clicking 'Talk to experts' you agree to processing of personal data according to the Privacy Policy.

Don't see what you're looking for?

  •  

    Visit our community

    Post your questions in the forum.

     
  •  

    Request additional resources

    Send us your requirements.

     
  •  

    Need implementation assistance?

    Try OnboardPro

     

On this page

Copyright © 2025, ZOHO Corp. All Rights Reserved.