I am trying to implement a user logoff script using group policy. My domain is at the Win2008 R2 functional level if it matters.
I have edited my default domain policy under User Config > Policies > Windows Settings > Scripts. I added a logoff script, which looks like this:
When I click the show files button, I see that the file is indeed in the folder:
I also verified that the script has replicated to all of the domain controllers and is accessible in the above folder on each DC. The permissions on the file are set as default, where authenticated users and users both have read and execute permissions.
If I manually go to a PC, open the run dialog box, and browse to that script, it runs fine.
I have manually refreshed the group policy on my PC (Windows 7 x64, which I am using to test the logoff script) by running gpupdate /force to ensure I have the latest GP settings applied, then I have tried logging off and rebooting, but the script does not run.
The script is a simple batch file that echoes the current date and time to a text file on the C: drive so I can tell when it has been run. When I run the script manually, it updates the text file, but when I logoff, the text file does not get updated.
As I understand, the script should be running in the context of the logged on user, but just to be sure this was not a permissions issue, I have assigned the everyone group full control of the text file that the script is supposed to update.
I have run gpresult /v and attached the output as gp.txt. I noticed that I don't see any logon or logoff scripts under the user configuration in the output.
In event viewer, I also see the following error, and this also occurs on the command line when I run gpupdate /force:
Searching on that error yielded the following MS page:
Which tells me that I can find info about debugging the error on this page:
Which has absolutely no information about how to debug this error.
Looking for any suggestions on where I should go from here.