GPO to lock computer


Is it possible to lock a computer via GPO at a given time? the client does not want an idle time out but a specific time.

Gareth McKeeCEO/OwnerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Will SzymkowskiSenior Solution ArchitectCommented:
No this cannot be done, using GPO's.

You can set restrictions for user log on times if that helps.
Gareth McKeeCEO/OwnerAuthor Commented:
any other ideas on how this can be achieved?
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.

Sure. Deploy a scheduled task that runs in the user context of any user and launches
rundll32.exe user32.dll, LockWorkStation
Gareth McKeeCEO/OwnerAuthor Commented:
hi Mcknife,

can you put some more meat on the bones there please :-)
What meat do you need?
Deploying a scheduled task to a single workstation or mass-deploy it?
If only one: add a task, set the trigger to run daily at the time you like, set the executing user to be the user that you would like this to apply to and set the action to be the command from above.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gareth McKeeCEO/OwnerAuthor Commented:
To all workstations.

created a task isn't a problem, schedule etc.

I am in the new action screen:

Action: Start a program?
Settings, Program/Script - you want me to enter 'rundll32.exe user32.dll, LockWorkStation ' ?
But if you want to deploy it, you need to set up the task as a group policy preference item as shown here:
Gareth McKeeCEO/OwnerAuthor Commented:
Yep, no problem there.

I have tried this locally on a PC, using the task scheduler. it asks me the following:

It appears as though arguments have been included in the Program text box. Do you want to run the following program: rundll32.exe

with the following arguments:
user32.dee, lockworkstation

I have tried the input as is, with "" and with '' but none seem to work. Am I missing a step here somewhere?
user32.dll, not .dee
no "" needed.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.