Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. FileSystemWatcher

FileSystemWatcher

Scheduled Pinned Locked Moved C#
questionsysadmin
10 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jacob D Dixon
    wrote on last edited by
    #1

    I have written an application using FileSystemWatcher and put the Windows Service on our data server. Now my question is, using FileSystemWatcher, is there a way to get the windows logon name that actually deleted the file? I realy want to know who deleted or created the files. Is this possible?

    L realJSOPR G 3 Replies Last reply
    0
    • J Jacob D Dixon

      I have written an application using FileSystemWatcher and put the Windows Service on our data server. Now my question is, using FileSystemWatcher, is there a way to get the windows logon name that actually deleted the file? I realy want to know who deleted or created the files. Is this possible?

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Depending on what Windows Server OS you have and how it's configured (NTFS I think) I believe Windows is capable of auditing the File System. You need to configure it of course.

      J 1 Reply Last reply
      0
      • L led mike

        Depending on what Windows Server OS you have and how it's configured (NTFS I think) I believe Windows is capable of auditing the File System. You need to configure it of course.

        J Offline
        J Offline
        Jacob D Dixon
        wrote on last edited by
        #3

        Our data server is running Server 2008 x64. So are you saying Windows has something built in instead of writing an app for it?

        L 1 Reply Last reply
        0
        • J Jacob D Dixon

          Our data server is running Server 2008 x64. So are you saying Windows has something built in instead of writing an app for it?

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          Jacob D Dixon wrote:

          So are you saying Windows has something built in instead of writing an app for it?

          Yes, I've never used it so I don't know where the MMC is located. It will write entries into the Security Log.

          J 1 Reply Last reply
          0
          • L led mike

            Jacob D Dixon wrote:

            So are you saying Windows has something built in instead of writing an app for it?

            Yes, I've never used it so I don't know where the MMC is located. It will write entries into the Security Log.

            J Offline
            J Offline
            Jacob D Dixon
            wrote on last edited by
            #5

            Ohh! Your talking about the File Screening. I think that just monitors saving files not deleting. I currently use that to block non image files from being saved to our images drive. Or are you speaking of somethign else? I guess I'm still wondering if using FileSystemWatcher can get the users login name?

            L 1 Reply Last reply
            0
            • J Jacob D Dixon

              Ohh! Your talking about the File Screening. I think that just monitors saving files not deleting. I currently use that to block non image files from being saved to our images drive. Or are you speaking of somethign else? I guess I'm still wondering if using FileSystemWatcher can get the users login name?

              L Offline
              L Offline
              led mike
              wrote on last edited by
              #6

              Jacob D Dixon wrote:

              Ohh! Your talking about the File Screening. I think that just monitors saving files not deleting.

              No, I'm talking about File System Auditing and it can Audit just about everything I believe.

              J 1 Reply Last reply
              0
              • L led mike

                Jacob D Dixon wrote:

                Ohh! Your talking about the File Screening. I think that just monitors saving files not deleting.

                No, I'm talking about File System Auditing and it can Audit just about everything I believe.

                J Offline
                J Offline
                Jacob D Dixon
                wrote on last edited by
                #7

                Ok I see what you are talking about. Thanks... I'm still curious if the FileSystemWatcher can do something like that.

                1 Reply Last reply
                0
                • J Jacob D Dixon

                  I have written an application using FileSystemWatcher and put the Windows Service on our data server. Now my question is, using FileSystemWatcher, is there a way to get the windows logon name that actually deleted the file? I realy want to know who deleted or created the files. Is this possible?

                  realJSOPR Offline
                  realJSOPR Offline
                  realJSOP
                  wrote on last edited by
                  #8

                  Yes, just get the currently logged on user name at the time you detect a file being deleted.

                  "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                  -----
                  "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                  J 1 Reply Last reply
                  0
                  • realJSOPR realJSOP

                    Yes, just get the currently logged on user name at the time you detect a file being deleted.

                    "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                    -----
                    "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                    J Offline
                    J Offline
                    Jacob D Dixon
                    wrote on last edited by
                    #9

                    The Windows Service that I made goes on a Data Server. The way everyone accesses it is by mapping a network drive (to the Data server) on their desktop PC's. So on the server using FileSystemWatcher can you get their information? The service is running under local system, but the person actually doing the deleting will be using a desktop PC that just has that network drive mapped. How do I get that person's logon name to log that they were the ones that deleted it?

                    1 Reply Last reply
                    0
                    • J Jacob D Dixon

                      I have written an application using FileSystemWatcher and put the Windows Service on our data server. Now my question is, using FileSystemWatcher, is there a way to get the windows logon name that actually deleted the file? I realy want to know who deleted or created the files. Is this possible?

                      G Offline
                      G Offline
                      Giorgi Dalakishvili
                      wrote on last edited by
                      #10

                      Power Threading Library[^] library includes class for reading NTFS change journal

                      Giorgi Dalakishvili #region signature My Articles Asynchronous Registry Notification Using Strongly-typed WMI Classes in .NET [^] My blog #endregion

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups