simulating domain users file operations

Hi guys,

I want to simulate in code that some domain user is copying file from location to another. This user is not the current logged in user.

I'm designing a testing tool that simulates domain users file operations to test access right on a certain folder.

Please tell me if this is possible or not and how and I'll be very thankful



Answer this question

simulating domain users file operations

  • Peemik

    Hi, Just to share thoughts

    I have came across similar problem, I think what you need to do is to have a Windows Service that only runs in each individual machine and detectes if users are logged onor not and it monitors all the files that bieng copied by the same user using the FileSytemWatcher and it records all the information to the SQL Database and link and you will write a small application to retreive this information from the Database and updating itself everytime.

    Hope this can give you ideas



  • Lapin_Agile

    Thanks Sibusiso for you help. but I need to do this without logging with this AD user. the tool should simulate a group of selected users file operations in the same time on the same machine. does anyone think that this is possible

    Thanks again for your suggestion because it contains good tips anyway


  • Varun.Prakash

    You could try one of the following:

    1) write a program that does the file copying you need to test for a single user. Then start several copies of the process using method System.Diagnostics.Process.Start (ProcessStartInfo info). In the ProcessStartInfo class you can specify the username, password and several other parameters that will be used to start the new process. The main disadvantage of this approach is that you will have to collect your feedback somehow, for instance having all the processes log to a DB.

    2) you can launch several threads each of which will call the API's LogonUser and ImpersonateLoggedOnUser. Each thread will then have a different identity. There was a small example here.

    Both approaches have their strong and weak points... your choice.

    HTH
    --mc


  • simulating domain users file operations