Windows Server 2012 R2.
There is an RDS_GPO policy, it is stored in the RDS OU.The RDS computer is located in the same OU, it is also a terminal server.
RDS_GPO has a huge number of policies, including computer policies and user policies.
User policies are successfully applied to all users who work on this computer.In my opinion, this is normal behavior.

There was a need to delete the% USERPROFILE% \ AppData \ Roaming \ Corel folder when you log off(but you can also log on) the user

I tried to reflect everything that was done on the screenshot:

If you copy the contents of podarok.bat and paste it into the command line of the user, press enter, then everything will succeed and the folder will be deleted.
But when you exit the system - it doesn’t work.

We tried to run the same podarok.bat from the user’s folder where it is stored:
\\ Amigo.local \ sysvol \ Amigo.local \ Policies \ {ED9FFD35-1E14-412D-B3FA-1DC173DE64B3} \ User \ Scripts \ Logoff
Access denied.

I would think that the matter is access rights to the folder \\ Amigo.local \ sysvol \ Amigo.local \ Policies \ {ED9FFD35-1E14-412D-B3FA-1DC173DE64B3} \ User \ Scripts \ Logoff
But the fact is that other files are stored in the same folder, which are executed perfectly when logging out, but are not executed in the same way(access denied) when the user manually calls these files in the session.

Where to dig?
I understand that there is not enough theory.
1.I do not know on whose behalf the script is executed upon exiting the system.
2.I don’t know if the user needs access to the file that is being executed, but I suspect that it is not needed, he described why above.


1 Answers 1

If you implement this through the GPO-User Settings-Preferences-Control Panel Settings-Schedule task and create a task in the task scheduler to run a script with logoff, it will be more convenient for you to debug.
  • I don’t quite understand.Will the task in the scheduler be created every time(with the logo) - new? Or how?
    And I don’t quite understand on whose behalf the task will be performed.
    I never used it, so it's hard to understand.

    Thank you for participating!!
    – Jealous Jay Nov 8 '19 at 13:42
  • [[grigoriyb]], the task will be created once or more than one, depending on your settings.
    The same applies to the user, or from the user to whom the settings will be applied, or from the specified one.
    – Different Dolphin Nov 8 '19 at 13:45