Tag Archives: PowerShell Get Shares

Get File Shares PowerShell Function

Get-FileShares PowerShell function will enumerate all shares (except administrative, but including those that end in a dollar sign ($) on a remote machine and optionally send the output to a CSV file.
The following share properties will be included in the export:
ServerName | ShareName | SharePath | Description

ServerName ShareName SharePath Description
FILESERVER01 \\FILESERVER01\CustomerCare E:\Groups\CustomerCare Customer Care Group Share
FILESERVER01 \\FILESERVER01\Groups_E$ E:\Groups\ Group Share Drive E:
FILESERVER01 \\FILESERVER01\Software$ D:\Software Hidden share for DCA use

Parameters

-servername
Defines the name of the target server
-export
Specifies the path of the exported CSV file

Syntax

or simply

This will generate a file c:\exports\FILESERVER01_Shares_01-15-2015.csv

Download Link

The Code