When you try to logoff an user using Windows Task Manager application in Windows 7/Vista, you may get an error message that says
User xxxx(SessionId = 1) could not be logged off. Access is denied"
This happens when the Task Manager does not have administrative privileges. To resolve the issue you need to launch the application in administrative mode by right clicking on the application icon and choosing the option “Run as Administrator”.
Once the Task Manager application launches, logoff the required user. It works without any issues.
Thanks to improved security measures in Windows 7 & Vista, we need to have administrative privileges to perform certain operations.