description | external help file | Module Name | ms.date | online version | schema | title |
---|---|---|---|---|---|---|
Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell. |
SmbShare.cdxml-help.xml |
SmbShare |
12/20/2016 |
2.0.0 |
Get-SmbShare |
Retrieves the SMB shares on the computer.
Get-SmbShare [[-Name] <String[]>] [[-ScopeName] <String[]>] [-Scoped <Boolean[]>] [-Special <Boolean[]>]
[-ContinuouslyAvailable <Boolean[]>] [-ShareState <ShareState[]>]
[-FolderEnumerationMode <FolderEnumerationMode[]>] [-CachingMode <CachingMode[]>]
[-ConcurrentUserLimit <UInt32[]>] [-AvailabilityType <AvailabilityType[]>] [-CaTimeout <UInt32[]>]
[-EncryptData <Boolean[]>] [-IncludeHidden] [-SmbInstance <SmbInstance>] [-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>] [-AsJob] [<CommonParameters>]
The Get-SmbShare cmdlet retrieves objects that represent the Server Message Block (SMB) shares being displayed by the computer.
PS C:\>Get-SMBShare
Name ScopeName Path Description
---- --------- ---- -----------
ADMIN$ * C:\Windows Remote Admin
C$ * C:\ Default share
ClusterStorage$ Contoso-SO C:\ClusterStorage Cluster Shared Volumes Def...
D$ * D:\ Default share
F$ * F:\ Default share
G$ * G:\ Default share
H$ * H:\ Default share
I$ Contoso-FS I:\ Cluster Default Share
I$ * I:\ Default share
IPC$ * Remote IPC
J$ Contoso-FS J:\ Cluster Default Share
J$ * J:\ Default share
K$ * K:\ Default share
L$ * L:\ Default share
M$ * M:\ Default share
N$ * N:\ Default share
VMS1 Contoso-FS I:\VMS
VMS2 Contoso-FS J:\VMS
VMS3 Contoso-SO C:\ClusterStorage\Volume1\VMS
VMS4 Contoso-SO C:\ClusterStorage\Volume2\VMS
VMS5 * D:\VMS
This command retrieves the SMB shares on the computer.
PS C:\>Get-SmbShare -Name "VMS1"
Name ScopeName Path Description
---- --------- ---- -----------
VMS1 Contoso-FS I:\VMS
This command retrieves information about the SMB share named 'VMS1' on the local computer.
PS C:\>Get-SmbShare -Name "VMS1" | Format-List
Name : VMS1
ScopeName : Contoso-FS
Path : I:\VMS
Description :
This command displays the information about the SMB share named 'VMS1' on the local computer as a formatted list.
PS C:\>Get-SmbShare -Name "VMS1" | Format-List -Property *
PresetPathAcl : System.Security.AccessControl.DirectorySecurity
ShareState : Online
AvailabilityType : Clustered
ShareType : FileSystemDirectory
FolderEnumerationMode : Unrestricted
CachingMode : Manual
CATimeout : 0
ConcurrentUserLimit : 0
ContinuouslyAvailable : True
CurrentUsers : 3
Description :
EncryptData : False
Name : VMS1
Path : I:\VMS
Scoped : True
ScopeName : Contoso-FS
SecurityDescriptor : O:BAG:DUD:(A;;FA;;;S-1-5-21-219828122-4198910963-4161819395-500)(A;;FA;;;S-1-5-21-219828122-419
8910963-4161819395-1106)(A;;FA;;;S-1-5-21-219828122-4198910963-4161819395-1109)
ShadowCopy : False
Special : False
Temporary : False
Volume : \\?\Volume{b02c4ba7-e6f1-11e1-93eb-0008a1c0ef0d}\
PSComputerName :
CimClass : ROOT/Microsoft/Windows/SMB:MSFT_SmbShare
CimInstanceProperties : {AvailabilityType, CachingMode, CATimeout, ConcurrentUserLimit...}
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties
This command displays all of the information about the SMB share named 'VMS1' on the local computer as a formatted list.
PS C:\>Get-SmbShare | Where-Object -Property AvailabilityType -Eq ScaleOut
Name ScopeName Path Description
---- --------- ---- -----------
ClusterStorage$ Contoso-SO C:\ClusterStorage Cluster Shared Volumes Def...
VMS3 Contoso-SO C:\ClusterStorage\Volume1\VMS
VMS4 Contoso-SO C:\ClusterStorage\Volume2\VMS
This command retrieves the SMB shares on the computer that have scaled out availability.
PS C:\>Get-SmbShare -ScopeName "Contoso-FS"
Name ScopeName Path Description
---- --------- ---- -----------
I$ Contoso-FS I:\ Cluster Default Share
J$ Contoso-FS J:\ Cluster Default Share
VMS1 Contoso-FS I:\VMS
VMS2 Contoso-FS J:\VMS
This command retrieves the SMB shares on the computer that are connected to the SMB server named Contoso-FS.
Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the cluster type of the shares being enumerated.
Type: AvailabilityType[]
Parameter Sets: (All)
Aliases:
Accepted values: NonClustered, Clustered, ScaleOut, CSV, DFS
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the continuous availability time-out of the shares being enumerated.
Type: UInt32[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the caching mode of the shares being enumerated.
Type: CachingMode[]
Parameter Sets: (All)
Aliases:
Accepted values: None, Manual, Documents, Programs, BranchCache, Unknown
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
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.
Type: CimSession[]
Parameter Sets: (All)
Aliases: Session
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the concurrent user limit of the shares being enumerated.
Type: UInt32[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Indicates that the shares being enumerated should be continuously available.
Type: Boolean[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Indicates that the shares being enumerated should be encrypted.
Type: Boolean[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the folder enumeration mode of the shares being enumerated.
Type: FolderEnumerationMode[]
Parameter Sets: (All)
Aliases:
Accepted values: AccessBased, Unrestricted
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-IncludeHidden
Indicates that shares that are created and used internally are also enumerated.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies one or more SMB shares by share name.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the scope of the share by name.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Indicates that the shares to be numerated should be scoped.
Type: Boolean[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the state of the shares being enumerated.
Type: ShareState[]
Parameter Sets: (All)
Aliases:
Accepted values: Pending, Online, Offline
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the input to this cmdlet. You can use this parameter, or you can pipe the input to this cmdlet.
Type: SmbInstance
Parameter Sets: (All)
Aliases:
Accepted values: Default, CSV, SBL, SR
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Indicates that the shares to be numerated should be special. Admin share, default shares, IPC$ share are examples of special shares.
Type: Boolean[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
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.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
The Microsoft.Management.Infrastructure.CimInstance
object is a wrapper class that displays Windows Management Instrumentation (WMI) objects.
The path after the pound sign (#
) provides the namespace and class name for the underlying WMI object.
The MSFT_SmbShare object represents the SMB shares on the computer.