0

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

Filburt
  • 17,626
  • 12
  • 64
  • 115
BigBoss
  • 413
  • 8
  • 23

1 Answers1

1

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.

David Doumèche
  • 508
  • 3
  • 10
  • I used LOGON32_LOGON_INTERACTIVE and it does not prompt for password. I am curious about knowing LOGON32_LOGON_NETWORK = 3 or LOGON32_LOGON_NETWORK_CLEARTEXT = 8 for process. – BigBoss Jun 06 '12 at 07:04