GPO Scheduled Task - Taskkill

I want to deploy a group policy to run a scheduled task at 9 PM each night to run a taskkill command. I only need it executed if the user is logged on, and I'd prefer to not have to enter credentials for the command that might change later, even though that's not as big a deal. I've had a devil of a time getting it to deploy, using either user configuration or computer configuration. Basically, I can't get anything to work so far. I only want it to run based on the user logged in, not at a whole machine level. What's the proper way of getting a command scheduled for users that I've added to a security group to run this command at a certain time?

BTW, I've noticed that whenever I establish a time in in AD it puts it one hour ahead of the time I specified, even though I see nothing at the server level that has inconsistencies with DST or the like.
Who is Participating?
William MillerInventory/IT ConsultantCommented:
Unfortunately, the error you're receiving is due to authentication. So for this GPO to run properly, you'll either need a credential for it to run against or it would need to run on an account that has that access. Likely your GPO is just fine, but it doesn't have the elevation to perform the task.
William MillerInventory/IT ConsultantCommented:
You should be able to load up Task Scheduler and configure everything from there. Have you created a script to run for this task? If so, you should be able to setup a scheduled time to run the script and enact it upon a security group. What steps have you taken so far in an attempt to run the taskkill operation?
js0873xAuthor Commented:
Here's what I did:

I set up a security group  and added 3 users to it
I added a GPO and linked it to the OU with security filtering to Authenticated Users (Read) and the new security group
The GPO used User Configuration / Preferences / Control Panel Settings / Scheduled Tasks
The scheduled task does not have "run as" so as to not need credentials (even though I've tried credentials without much luck either)
The task is under Run: taskkill with the parameters it needs as arguments
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

What is the result of your setting?
Another option using a user GPO and login/logout process
Login will create the schtasks and schedule it
Logout will delete the task.

specifics are missing, are you trying to force user to logoff.

Your issue might be the reference to the batch file where taskkil is envoked or the parameters you are setting with your schedule get misinterpreted ir running into an issue...
js0873xAuthor Commented:
How do you create a scheduled task at the login time and delete it at log off?  

And an option to force a log off might be decent too, although I'd only want that on certain machines, not necessarily tied to the user.

The taskkill command I'm wanting to issue is simple. It's like this: Taskkill /IM prowin32.exe /F
William MillerInventory/IT ConsultantCommented:
How are you configuring the GPO? What are you using to launch the taskkill command when you schedule the task? Batch? When the task runs, do you see any corresponding errors in the Event Log? Does the task attempt to run at all?
js0873xAuthor Commented:
I believe it attempted to run but I got this in the event viewer:

The user 'FIMS Log Off at 10 PM' preference item in the 'FIMS Log Off at 10 PM {1327EFB3-7D06-48D4-BA58-63C5D78FA352}' Group Policy object did not apply because it failed with error code '0x80070005 Access is denied.' This error was suppressed.
Seth SimmonsSr. Systems AdministratorCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: William Miller (https:#a42348990)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

Experts-Exchange Cleanup Volunteer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.