Pages

Tuesday, July 19, 2011

Export owner information of folders into a CSV file by using Power Shell command

 

I have been in search of getting a command which help me to find out owner of folders in a share. My ideas was to create a report of folder with owner information so that I can send the report to the owners and ask them to clear it off from the share if not required or get back to me with proper justification why they want to keep it there.

I did lot of search in google Smile but nothing turned, I know there is easy way in powershell. [as you may know Power Shell is the tool which will help you to hack windows]

Lets check how I figured it,

  1. From PS locate the folder.
  2. type ‘Dir |get-acl’ and enter,
    This will list all the folders and files with owner information.
  3. Below command will help you to export the owner information to CSV file.
    dir |get-acl |select-object path,owner |Export-Csv test.csv -NoTypeInformation

No comments:

Post a Comment