CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2009
    Posts
    12

    How to retrieve logged on user credentials for ITask::SetAccountInformation

    I need to user Windows Task Scheduler to to invoke an application which will store some data under logged on user’s profile. However,I will need to explicitely pass credentials of the current logged on user to the SetAccountInformation(LPCWSTR pwszAccountName, LPCWSTR pwszPassword) method. Is that possible to retrieve the user credentials without using CredUIPromptForCredentials method to ask and pass it to SetAccountInformation method? Or do you have any suggestion to get around this?

    My basic requirements are:
    1) Use Windows Task Scheduler to invoke an appliation
    2) This application needs to write some data under user profile, say My Documents.

    Thanks.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to retrieve logged on user credentials for ITask::SetAccountInformation

    Quote Originally Posted by jchliu View Post
    Is that possible to retrieve the user credentials without using CredUIPromptForCredentials method to ask and pass it to SetAccountInformation method?
    No, if you were able to do this, it would be a severe security hole.

  3. #3
    Join Date
    Jan 2008
    Posts
    48

    Re: How to retrieve logged on user credentials for ITask::SetAccountInformation

    Yes, but it's advanced code (remote process hooking)

  4. #4
    Join Date
    Jul 2009
    Posts
    12

    Re: How to retrieve logged on user credentials for ITask::SetAccountInformation

    Do you have code sample that I can play with it? Thanks very much...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured