I want to run a script in the shutdown of the computer to copy some files from the user's My Documents that was logged in. So, I set the script in the GPO Computer Configuration Shutdown Script. The problem is that this script runs with machine account, so I can not identify which user is shutting down the computer (%username% is blank). Realizing this, I removed the script from Computer Configuration Shutdown and I put it on User Configuration Logoff Script. Now the problem is that the script is executed whenever the user logs off, restarts or shuts down the computer, and what I want is that the script run (copy the files from User's My Documents) only when the user turns off its computer. So how can I achieve this?