Solved

Powershell with robocopy for finding folder size

Posted on 2013-11-26
5
596 Views
Last Modified: 2013-11-26
Got the code  for extracting share details from below link . Could you please help how to export  a remote server  share details with this code .  

http://www.expertsexchange.com/Programming/Languages/Scripting/Powershell/Q_28303849.html


code
Get-WmiObject Win32_Share | ?{$_.Type -eq 0} | Select Name,Path | Export-Csv C:\report.csv

----------------------------
0
Comment
Question by:Shani Basha
  • 3
5 Comments
 
LVL 20

Expert Comment

by:Patrick Bogers
ID: 39678909
Hi

Do you mean something like this?
 
Get-WmiObject win32_Share -computername remotecomputername
0
 
LVL 40

Expert Comment

by:Subsun
ID: 39678922
Use ComputerName parameter to get info about remote computer.. I have added custom property Sharepath to get the UNC path for directory..
Get-WmiObject Win32_Share -ComputerName "ServerA" | ?{$_.Type -eq 0} | Select Name,Path,@{N="Sharepath";E={"\\$($_.__SERVER)\$($_.Name)"}} | Export-Csv C:\report.csv

Open in new window

0
 
LVL 9

Author Comment

by:Shani Basha
ID: 39678974
. Actually i am trying to export share details from a netapp v filer ( virtual cifs server).

I can connect computer managmentent of  vfiler and export share details  as a windows server

the  Get-WmiObject Win32_Share is not working since its not a windows server. is there a

way to write code like by connecting computer management and then export share details
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39678992
In computer management share folder, you can just right click and export the list to csv file..
0
 
LVL 40

Expert Comment

by:Subsun
ID: 39679038
Another option is to use NetApp  powershell module command Get-nacifsshare..

Here is an example..
Import-Module dataontap
connect-nacontroller "filer02"
Get-nacifsshare | Select -expand ShareName

Open in new window

0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to sign a powershell script so you can prevent tampering, and only allow users to run authorised Powershell scripts
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question