Unlock Windows PC RRS feed

  • Question

  • I have a PC that needs to lock at a certain time and lock at a certain time (PC is connected to a large display showing production information. TV powers on and off using it's built-in timers)

    I'm using a Scheduled task to perform the workstation lock.

    But cannot find a command line / PowerShell command to unlock the PC


    • Moved by jrv Wednesday, February 26, 2020 5:20 PM NOT A POWERSHELL QUES
    Tuesday, February 25, 2020 2:51 PM

All replies

  • Hi Steve.

    You can lock a PC using a scheduled task, but I don't think you can programmatically unlock it: as far as I know, there is no documented API that would allow you to do that.
    Take a look at the thread at https://social.technet.microsoft.com/Forums/windowsserver/en-US/18601a8a-9934-4f6d-b0b5-0130fd863afc/how-to-unlock-a-workstation-throught-command-prompt?forum=winservergen.


    Luigi Bruno

    • Edited by Luigi BrunoMVP Tuesday, February 25, 2020 3:19 PM
    • Proposed as answer by jrv Tuesday, February 25, 2020 4:32 PM
    Tuesday, February 25, 2020 3:17 PM
  • GPO are your go-to if it's in an AD environment.


    Tuesday, February 25, 2020 3:20 PM
  • Thanks for the feedback - they all cover how to Lock the system but not how to Unlock

    Am looking for an Unlock solution

    Tuesday, February 25, 2020 3:33 PM
  • You can configure an auto logon for the start. So you just have to restart at a certain time and have this auto logon configured.  ;-)

    Live long and prosper!


    Tuesday, February 25, 2020 3:37 PM
  • Scenario we have at this end is that the App needs to be displayed on the screen in a certain way. So we leave the App running and then just unlock and lock the system each day.

    There is a 3rd party app that can unlock the system and we may just go with it. Would rather use built in features.

    Tuesday, February 25, 2020 3:40 PM
  • At this point, open/close the TV manually will be also the answer.
    Tuesday, February 25, 2020 3:44 PM
  • The only way to do this is with a custom Gina.  This can be a very dangerous thing to do and it requires a special program to both do this and to replace the Microsoft Gina dll.

    There is no command or API in Windows that can unlock a locked PC from code.


    • Proposed as answer by BOfH-666 Tuesday, February 25, 2020 4:37 PM
    Tuesday, February 25, 2020 4:36 PM
  • I ended up using a product called LogonExpert.

    It will unlock the PC from a locked state

    • Proposed as answer by Nevets24 Wednesday, February 26, 2020 2:54 PM
    Wednesday, February 26, 2020 11:02 AM