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.
Re: How to retrieve logged on user credentials for ITask::SetAccountInformation
Quote:
Originally Posted by
jchliu
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.
Re: How to retrieve logged on user credentials for ITask::SetAccountInformation
Yes, but it's advanced code (remote process hooking)
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...