Solved

Powershell with robocopy for finding folder size

Posted on 2013-11-26
5
599 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 22

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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

A brief introduction to what I consider to be the best editor for PowerShell.
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

680 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