I am planning to use impersonation in Web Application to copy files to target network shared location. I want to copy many files to many Network locations and traffic is high in peak hours. I could batch copy many files to many network locations at intervals.
I would be using following code for implementation http://support.microsoft.com/kb/306158
Please advise me on which LogonType I should use. As per my understanding available LogonType for my scenario are as follows.
- LOGON32_LOGON_INTERACTIVE = 2
- LOGON32_LOGON_NETWORK = 3
- LOGON32_LOGON_NETWORK_CLEARTEXT = 8
At present I am planning to use LOGON32_LOGON_INTERACTIVE
LOGON32_LOGON_INTERACTIVE should be avoided since it should open a prompt on client terminal asking for password, consider LOGON32_LOGON_NETWORK or LOGON32_LOGON_BATCH instead. If you considering using batch process, the impersonation should use the desktop LogonUser api : http://msdn.microsoft.com/en-us/library/windows/desktop/aa378184%28v=vs.85%29.aspx
Or schedule the task and run it as a specific user.