Solved

Powershell with robocopy for finding folder size

Posted on 2013-11-26
5
602 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 23

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
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…
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…

738 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