How do I disable the Guest user from shutting down the PC while the Admin is logged in?

I'm running Windows 7 Ultimate. I found out how to disable the Guest user from shutting down at all via Local Security Policy, but then they can't shutdown even if Admin account is logged off.

To clarify a little, say I want to give my PC to someone, I usually click on Switch User and log in using the Guest account. That way, they can't access my account as it asks for a password. I want that in such a case, they shouldn't be able to shut down the PC as my admin account is still logged on.

However, if someone else boots up the PC themselves and uses the Guest account, then they should be able to shut it down too, as my Admin account hasn't been logged on.

Answer
Answer

I'm running Windows 7 Ultimate. I found out how to disable the Guest user from shutting down at all via Local Security Policy.

This is the correct method. It is also robust in that it is unconditional.

If you wish to have your cake and eat it then the Guest account must use a powerful "agent" to perform the shutdown task. A scheduled task would be such an agent. It could work like so:

  1. Create a scheduled task that runs Script1 to perform these tasks:
    - Check if the file C:\Shutdown\Shutdown.txt exists.
    - If it does not, exit from the script.
    - If it does, delete Shutdown.txt.
    - Check if there is a live Administrator session. If yes, exit from the script.
    - If there is no live Administrator session, shut down the machine, using shutdown.exe.
    The task must run once every 3 minutes under an admin account.
  2. Create a desktop shortcut for the Guest user that invokes Script2 to perform these tasks:
    - Check if there is a live Administrator session.
    - If it does, create a pop-up to inform the user that the machine cannot be shut down.
    - If it does not, create the file C:\Shutdown\Shutdown.txt. The scheduled task will "see" this file and will shut down the machine.

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated November 29, 2023 Views 428 Applies to: