This has been tested with windows xp/vista/7
1. Control Panel –> Administrative Tools –> Local Security Policy
2. Expand Local Policies –> Security Options
3. Open “Shutdown: Allow system to be shut down without having to log on” –> simply disable the option
This is a great function if you are running task and do not want a random user shutting down your computer while you have it locked. But there is always the power button!