title: In windows - API - How to get/use the current users privileges( or single sign on)
body: <p>I am using vc++. I am trying to create a "front end" which will create a task and put that in " Window's native Scheduler". The task's action is invoking a backup app. Every task needs some privileges to execute the given program. I need to assign administrator privileges to this task. I can assure that the front end can be run by admin only. Now I want to use assign the current user's(admin) privileges to the task. Upto the dig I did in internet/msdn , the api provides below two options( 3rd option is my assumption)</p>
  
  <p>1) Provide account name,password for that task.</p>
  
  <p>2) Use flag "TASK_FLAG_RUN_ONLY_IF_LOGGED_ON", and give the administrator "account name", and password as NULL.</p>
  
  <p>3)Single Sign on</p>
  
  <p>Now the constraints:</p>
  
  <p>1->It is not a good idea to make the client to type the admin account name and password frequently</p>
  
  <p>2->Admin Account name is not always the same(in XP it is possible to change it). So I can't provide a default admin account name.</p>
  
  <p>3-> I don't know how to achieve it. The "single sign on" is something like once you logged in as admin, then the applications can get the current(logged in) user's privileges.</p>
  
  <p>Searching MSDN for this is like "searching a needle in hay stack". Somebody, please shed a light on the solution.</p>