0

I have list of remote sharepaths which i dont have direct access, I want to find out Owner of each share and total space . Is there any way to find it out using powershell script??

Thanks In advance jerin

user3480406
  • 11
  • 1
  • 8
  • Shares don't have owners. And what exactly do you mean by "total space"? The total size of the files/folders under that share? The total diskspace provided by the file system? And most importantly: what have you tried so far to solve this yourself? – Ansgar Wiechers Jun 20 '14 at 11:57
  • Shares do have owners. Look under the advanced security permissions. What do you mean you don't have direct access? – Kevin_ Jun 20 '14 at 12:18
  • The 'owner' is a property of the file system directory, not the share itself. – Bill_Stewart Jun 20 '14 at 14:59
  • @Kevin_ You're confusing NTFS permissions with share permissions. Folders have owners. Shares don't. – Ansgar Wiechers Jun 20 '14 at 19:18
  • @AnsgarWiechers eh, same thing. I believe thats what OP is referring to. – Kevin_ Jun 20 '14 at 19:19
  • @Kevin_ Perhaps. But until the OP decides to clarify the question we won't know. – Ansgar Wiechers Jun 20 '14 at 19:23

1 Answers1

0

Getting the owner of a folder works the same way regardless of whether it's a local folder or a share. Simply use UNC:

$path = <path_to_folder> # For example: \\server_name\share_name
Get-Acl $path | Select-Object -ExpandProperty Owner

It's not clear from your question whether you want to get free space on the volume where the folder is located or the total size of all items in the folder. Anyway:

Finding free space: http://blogs.technet.com/b/josebda/archive/2010/04/08/using-powershell-v2-to-gather-info-on-free-space-on-the-volumes-of-your-remote-file-server.aspx

Finding the total size: http://technet.microsoft.com/en-us/library/ff730945.aspx

Alexander Obersht
  • 3,215
  • 2
  • 22
  • 26
  • [Here](http://stackoverflow.com/a/24091871/1751302) is a function to find total size. – noam Jun 20 '14 at 15:58