[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Powershell with robocopy for finding folder size

Posted on 2013-11-26
5
Medium Priority
?
610 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 1500 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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 this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

656 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