Hello Jasper Vandenbrande,
Thank you for posting in Q&A forum.
The login script should be stored in the sysvol file. A SYSVOL is a shared folder that stores a copy of a domain's public file servers, which are replicated among all domain controllers in the domain. The sysvol folder is created when AD is installed, and it is used to store information such as GPO and Script. At the same time, the information stored in the sysvol folder is copied to all DCs in the domain. For more information about sysvol files, please refer to the Active Directory: Active Directory: SYSVOL and NETLOGON | Microsoft Learn.
If you implement a boot script and apply startup script to domain computer, the script file needs to be stored in IP or hostname\sysvol\domain name\Policies\unique ID\Machine\Startup.
In your case, you want to implement a login script and apply logon script to domain users, the script file needs to be placed in IP or hostname\sysvol\domain name\Policies\unique ID\USER\Scripts\Logon
You can try the steps below:
1.Create an OU and put user objects into this OU.
2.Create one GPO and you can rename this GPO as logon script.
3.Put the this command line or Power Shell script file to this folder below: \domain.com\SYSVOL\domain.com\Policies{5EE96627-35BD-434C-9C6A-4AE328E7D13A}\User\Scripts\Logon
4.Edit this GPO as below.
Navigate to User Configuration Policies\Windows Settings\Scripts (Logon/Logoff)
Right click Logon and select the logon script under the path \domain.com\SYSVOL\domain.com\Policies{5EE96627-35BD-434C-9C6A-4AE328E7D13A}\User\Scripts\Logon
5.If the specific users logon, then this user will apply the logon GPO.
Please check out the links below: Working with startup, shutdown, logon, and logoff scripts using the Local Group Policy Editor | Microsoft Learn.
For more information, you can also check the following link for details: Running PowerShell Startup (Logon) Scripts Using GPO | Windows OS Hub (woshub.com).
I hope the information above is helpful.
If you have any question or concern, please feel free to let us know.
I hope the information above is helpful.
If you have any question or concern, please feel free to let us know.
Best Regards,
Daisy Zhou
If the Answer is helpful, please click "Accept Answer" and upvote it.