locked
Get Details of files in a folder RRS feed

  • Question

  • Hi Experts,

    Could you please share a sample script on how to get the details about who uploaded,when uploaded,file_Name in the folder for the current date.

    Thanks

    Priya

    Thursday, August 2, 2018 4:05 AM

All replies

  • Please carefully review the following links to set your expectation for posting in  technical forums.

    This Forum is for Scripting Questions Rather than script requests


    \_(ツ)_/

    Dear Sir,

    I have never faced such challenge in the SQL Server community . They are very supportive and never had to face any guidelines issue. I just requested for a script somebody could be in some major challenge and unable to wear multiple hats due to work stress. These communities are primarily to help. Currently my situation doesn't allow me to learn new stuff and I always mention am new to Powershell most of the time in my post.

    Thanks

    Priya

    • Marked as answer by jrv Thursday, August 2, 2018 4:33 AM
    • Unmarked as answer by jrv Thursday, August 2, 2018 4:33 AM
    Thursday, August 2, 2018 4:23 AM
  • Please understand that this is not a script sharing forum.  It is for those that are actively using scripting and have specific scripting questions.

    Some forums are more customer support and about helping users with the GUI or with finding resources.

    I have posted links to resources that can help you.  There is a specific link for script requests.  Post on that link or look in th Gallery for pre-written scripts.


    \_(ツ)_/

    Thursday, August 2, 2018 4:36 AM
  • Hi Priya,

    Thanks for your question.

    Get-ChildItem -path "FilePath" | select-object -property *

    You can get some details about the file folder by the cmdlet Get-ChildItem.  But if you want to get the details about who uploaded, you need to get it in other ways.

    Best Regards,

    Lee


    Just do it.

    Thursday, August 2, 2018 8:52 AM
  • Hi Experts,

    Could you please share a sample script on how to get the details about who uploaded,when uploaded,file_Name in the folder for the current date.

    Thanks

    Priya

    Sorry using PS who uploaded you can not fetch. You can fetch the below information using PS:-

    And to fetch this  just locate the directory in powershell and run the below command:-

     

    PS C:\Users\kumar_g\Pictures> Get-ChildItem | select *

    or if you want to locate directory then use below command :-

    PS C:\> Get-ChildItem -path "C:\Users\kumar_g\Pictures" | select *

    Here are all the all attribute, what you will get in result:-

    PSPath            : Microsoft.PowerShell.Core\FileSystem::C:\Users\kumar_g\Pictures\Camera Roll
    PSParentPath      : Microsoft.PowerShell.Core\FileSystem::C:\Users\kumar_g\Pictures
    PSChildName       : Camera Roll
    PSDrive           : C
    PSProvider        : Microsoft.PowerShell.Core\FileSystem
    PSIsContainer     : True
    Mode              : d-r---
    BaseName          : Camera Roll
    Target            : {}
    LinkType          :
    Name              : Camera Roll
    FullName          : C:\Users\kumar_g\Pictures\Camera Roll
    Parent            : Pictures
    Exists            : True
    Root              : C:\
    Extension         :
    CreationTime      : 14-12-2017 13:47:58
    CreationTimeUtc   : 14-12-2017 08:17:58
    LastAccessTime    : 14-12-2017 13:47:58
    LastAccessTimeUtc : 14-12-2017 08:17:58
    LastWriteTime     : 14-12-2017 13:47:58
    LastWriteTimeUtc  : 14-12-2017 08:17:58
    Attributes        : ReadOnly, Directory

    -edit-

    This will give everything 

    Get-ChildItem | Select Name, @{n='Owner';e={ $_.GetAccessControl().Owner}}


    Cheers, Gourav Please remember to mark the replies as answers if it helped.


    • Proposed as answer by GouravIN Thursday, August 2, 2018 9:31 AM
    • Edited by GouravIN Thursday, August 2, 2018 9:59 AM
    Thursday, August 2, 2018 9:30 AM
  • C'mon people.  Get with the program.  Take time to read the help and learn PowerShel instead of just guessing and copying what you have seen on the net.

    Get-ChildItem -file | 
         Select Name, @{n='Owner';e={ $_.GetAccessControl().Owner}}

    Now...what part of the file "owner" is not available?

    If you are talking about file "uploaded" to a web server then you will have to scan the server logs for the account that uploaded the file.


    \_(ツ)_/

    Thursday, August 2, 2018 9:46 AM