< Back

Get-FileShare

Wed Jan 30, 2019 6:02 pm

NAME Get-FileShare



SYNOPSIS

Retrieves file share objects and their properties.





SYNTAX

Get-FileShare [-CimSession <CimSession[]>] [-FileServer <CimInstance>] [-Name <String[]>] [-Protocol <FileSharingProtocol[]>] [-ThrottleLimit <Int32>]

[<CommonParameters>]



Get-FileShare [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [-UniqueId <String[]>] [<CommonParameters>]



Get-FileShare [-CimSession <CimSession[]>] [-Name <String[]>] [-Protocol <FileSharingProtocol[]>] [-ThrottleLimit <Int32>] [-Volume <CimInstance>]

[<CommonParameters>]



Get-FileShare [-CimSession <CimSession[]>] [-Name <String[]>] [-Protocol <FileSharingProtocol[]>] [-Subsystem <CimInstance>] [-ThrottleLimit <Int32>]

[<CommonParameters>]





DESCRIPTION

The Get-FileShare cmdlet gets objects that correspond to the file shares on the specified server. You must have local administrator credentials on a

server to retrieve the objects.





PARAMETERS

-CimSession [<CimSession[]>]

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or

Get-CimSession cmdlet. The default is the current session on the local computer.



Required? false

Position? named

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-FileServer [<CimInstance>]

Specifies the file server on which the file share is hosted. To obtain a FileServer, use the Get-StorageFileServer cmdlet.



Required? false

Position? named

Default value none

Accept pipeline input? true(ByValue)

Accept wildcard characters? false



-Name [<String[]>]

Specifies the name of the file share to get.



Required? false

Position? named

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-Protocol [<FileSharingProtocol[]>]

Specifies the file sharing protocol of the file shares that this cmdlet gets. The acceptable values for this parameter are: SMB and NFS.



Required? false

Position? named

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-Subsystem [<CimInstance>]

Specifies the storage subsystem from which to get file shares. To obtain a StorageSubsystem object, use the Get-StorageSubSystem cmdlet.



Required? false

Position? named

Default value none

Accept pipeline input? true(ByValue)

Accept wildcard characters? false



-ThrottleLimit [<Int32>]

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is

entered, then Windows PowerShell???? calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the

computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.



Required? false

Position? named

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-UniqueId [<String[]>]

Specifies a unique ID.



Required? false

Position? named

Default value none

Accept pipeline input? true(ByPropertyName)

Accept wildcard characters? false



-Volume [<CimInstance>]

Specified the volume object that contains the file share to get. To obtain a volume, use the Get-Volume cmdlet.



Required? false

Position? named

Default value none

Accept pipeline input? true(ByValue)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS











OUTPUTS











Example 1: Get all file shares on the local server



PS C:\\>Get-FileShare



This command lists all the file shares on the local server. You must have local administrator permissions on the server to run this command.





Example 2: Get all NFS file shares on the specified file server



PS C:\\>Get-FileShare -Protocol NFS -FileServer (Get-StorageFileServer -FriendlyName "FileServer01")



This command lists all NFS file shares on the file server named FileServer01. You must have local administrator credentials on the server to run this

command. The command gets the file server by using the Get-StorageFileServer cmdlet.







RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=816379

Get-StorageFileServer

Get-StorageSubsystem

Get-Volume