Link to home
Start Free TrialLog in
Avatar of js0873x
js0873xFlag for United States of America

asked on

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.
Avatar of William Miller
William Miller
Flag of United States of America image

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?
Avatar of js0873x

ASKER

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
Avatar of arnold
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...
Avatar of js0873x

ASKER

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
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?
Avatar of js0873x

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of William Miller
William Miller
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.

seth2740
Experts-Exchange Cleanup Volunteer