Link to home
Start Free TrialLog in
Avatar of Gareth McKee
Gareth McKeeFlag for Canada

asked on

GPO to lock computer

Hi,

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.

thanks
gareth
Avatar of Will Szymkowski
Will Szymkowski
Flag of Canada image

No this cannot be done, using GPO's.

Will.
You can set restrictions for user log on times if that helps.
Avatar of Gareth McKee

ASKER

any other ideas on how this can be achieved?
Sure. Deploy a scheduled task that runs in the user context of any user and launches
rundll32.exe user32.dll, LockWorkStation
hi Mcknife,

can you put some more meat on the bones there please :-)
ASKER CERTIFIED SOLUTION
Avatar of McKnife
McKnife
Flag of Germany 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
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 ' ?
Exactly.
But if you want to deploy it, you need to set up the task as a group policy preference item as shown here: https://technet.microsoft.com/en-us/library/cc725745.aspx
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?
typo?
user32.dll, not .dee
no "" needed.