Поделиться через


MSFT_SmbShare class

Represents an SMB share.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties.

Syntax

[dynamic, provider("smbwmiv2"), ClassVersion("30"), DisplayName("Smb Share"), AMENDMENT]
class MSFT_SmbShare
{
  string  Name;
  string  ScopeName;
  boolean Scoped;
  uint32  ShareType;
  boolean Special;
  boolean Temporary;
  boolean ShadowCopy;
  string  Path;
  string  Volume;
  string  Description;
  uint32  ConcurrentUserLimit;
  uint32  CurrentUsers;
  string  SecurityDescriptor;
  boolean EncryptData;
  uint32  FolderEnumerationMode;
  uint32  CachingMode;
  boolean ContinuouslyAvailable;
  uint32  CATimeout;
  uint32  ShareState;
  uint32  SmbInstance;
  uint32  AvailabilityType;
};

Members

The MSFT_SmbShare class has these types of members:

Methods

The MSFT_SmbShare class has these methods.

Method Description
BlockAccess Updates a share's security descriptor to block accounts from accessing a share.
CreateShare Creates a new share and allows the creator to specify initial access rights that determine who can and can't access the newly created share.
EnumerateShares Enumerates the specified shares.
FireShareChangeEvent This method is reserved for system use.
GetAccessControlEntries Retrieves the access rights that have been granted to the share.
GetShare Returns a specified share instance.
GrantAccess Updates a share's security descriptor to grant accounts permission to access a share.
RevokeAccess Updates a share's security descriptor to revoke permission to access a share from a set of accounts.
UnblockAccess Updates a share's security descriptor to unblock accounts from accessing a share.

Properties

The MSFT_SmbShare class has these properties.

AvailabilityType

Data type: uint32

Access type: Read-only

The availability status of the share.

NonClustered (0)

Clustered (1)

ScaleOut (2)

CSV (3)

DFS (4)

CachingMode

Data type: uint32

Access type: Read/write

The caching policy for the share.

None (0)

Manual (1)

Documents (2)

Programs (3)

BranchCache (4)

Unknown (5)

CATimeout

Data type: uint32

Access type: Read/write

In case of a failover, the number of seconds the client will wait before failing the operation.

ConcurrentUserLimit

Data type: uint32

Access type: Read/write

Maximum number of users that may concurrently access the share. If this property is zero, there is no limit.

ContinuouslyAvailable

Data type: boolean

Access type: Read/write

Indicates whether the share supports continuous availability.

CurrentUsers

Data type: uint32

Access type: Read/write

Number of users that are currently connected to this share.

Description

Data type: string

Access type: Read/write

Optional description of the share.

EncryptData

Data type: boolean

Access type: Read/write

Indicates whether the data on the share should be encrypted.

FolderEnumerationMode

Data type: uint32

Access type: Read/write

The enumeration mode that is enabled for the share.

AccessBased (0)

Access-based

Unrestricted (1)

Unrestricted

Name

Data type: string

Access type: Read-only

Qualifiers: key

Name of the share.

Path

Data type: string

Access type: Read-only

Absolute path to the file system directory that is shared. Null if ShareType is not File System Directory.

Scoped

Data type: boolean

Access type: Read-only

Indicates whether the share is scoped.

ScopeName

Data type: string

Access type: Read-only

Qualifiers: key

Name of the endpoint to which the share is scoped.

SecurityDescriptor

Data type: string

Access type: Read/write

SDDL-formatted security descriptor for the share.

ShadowCopy

Data type: boolean

Access type: Read-only

Indicates whether the share represents a shadow copy for Remote VSS for File Shares (RVSS).

ShareState

Data type: uint32

Access type: Read-only

The current state of the share.

Pending (0)

Online (1)

Offline (2)

ShareType

Data type: uint32

Access type: Read-only

Indicates the type of resource that is shared.

File System Directory (0)

File share

Print Queue (1)

Print queue

Communication Device (2)

Communication device

Interprocess Communication (3)

Interprocess communication (IPC) mechanism

Unknown (4)

Unknown

SmbInstance

Data type: uint32

Access type: Read-only

The identifier of the SMB server instance that hosts the shares.

Windows Server 2012 and Windows 8: This property is not supported before Windows Server 2012 R2 and Windows 8.1.

Default (0)

CSV (1)

Represents a Cluster Shared Volume (CSV).

Windows 10 and Windows 8.1: Cluster Shared Volumes are only supported on Windows Server systems.

SBL (2)

Represents a Software Storage Bus used in Storage Spaces Direct.

Windows Server 2012 R2 and Windows 8.1: This value is not supported before Windows Server 2016 and Windows 10.

SR (3)

Represents a Storage Replica (SR).

Windows Server 2012 R2: This value is not supported before Windows Server 2016.

Windows 10 and Windows 8.1: Storage Replica is only supported on Windows Server systems.

Special

Data type: boolean

Access type: Read-only

Indicates whether this is a special share.

Temporary

Data type: boolean

Access type: Read-only

Indicates whether this is a temporary share.

Volume

Data type: string

Access type: Read-only

Name of the volume that hosts the directory specified by Path. This name can be a volume mount point. For more information, see Naming a Volume.

NullShareType is not File System Directory.

Remarks

There will be one instance of this class per existing share on the system.

Requirements

Minimum supported client
Windows 8
Minimum supported server
Windows Server 2012
Namespace
Root\Microsoft\Windows\Smb
MOF
SmbWmiV2.mof
DLL
SmbWmiV2.dll