Announcement

Collapse
No announcement yet.

Script to find file owner and last date modified

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Script to find file owner and last date modified

    Hi - I need to write a script which will search my file server for files created by a specific owner. I then need the list of files output to a text file with last date modified. I appreciate any help. thx

  • #2
    Re: Script to find file owner and last date modified

    well, what do you have to start out with
    Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

    Comment


    • #3
      Re: Script to find file owner and last date modified

      not much

      gci -Recurse | % { # Get a recursive list of child items, that is, dir
      if

      thx

      Comment


      • #4
        Re: Script to find file owner and last date modified

        Look up System.IO.FileInfo from MSDN.

        This one prints file name, owner and last write time. You could work from there to filter files according owner, right?

        Code:
        gci | % { write-host ("{0}: {1} {2}" -f $_.FullName, $_.GetAccessControl().Owner, $_.LastWriteTime.ToString("s")) }
        -vP
        Last edited by vonPryz; 18th June 2010, 20:31. Reason: Add some content.

        Comment


        • #5
          Re: Script to find file owner and last date modified

          yes, i could.. thank you very much for ur help

          Comment


          • #6
            Re: Script to find file owner and last date modified

            You are welcome. Please post your solution so that the community can benefit from it too.

            -vP

            Comment

            Working...
            X