5 out of 10 rated this helpful - Rate this topic

Win32_Share class

The Win32_Share class represents a shared resource on a computer system running Windows. This may be a disk drive, printer, interprocess communication, or other sharable device. For more information about retrieving WMI classes, see Retrieving a Class.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties. Properties and methods are in alphabetic order, not MOF order.

Syntax

class Win32_Share : CIM_LogicalElement
{
  uint32   AccessMask;
  boolean  AllowMaximum;
  string   Caption;
  string   Description;
  datetime InstallDate;
  uint32   MaximumAllowed;
  string   Name;
  string   Path;
  string   Status;
  uint32   Type;
};

Members

The Win32_Share class has these types of members:

Methods

The Win32_Share class has these methods.

MethodDescription
Create

Class method that initiates sharing for a server resource.

Delete

Class method that deletes a share name from a server's list of shared resources, disconnecting connections to the shared resource.

GetAccessMask

Returns the access rights to the share held by the user or group on whose behalf the instance is returned. You should use this method in place of the AccessMask property, which is always NULL.

Windows NT 4.0 and Windows Me/98/95:  This method is unavailable. Use the AccessMask property instead.
SetShareInfo

Class method that sets the parameters of a shared resource.

 

Properties

The Win32_Share class has these properties.

AccessMask
Data type: uint32
Access type: Read-only

This property is obsolete and is no longer used. Use the Win32_Share.GetAccessMask method instead. The value of the AccessMask property is set to null by WMI. For more information about setting access when a share is created, see the Create method.

Windows 2000 and Windows NT 4.0:  Bit array that represents the access rights that are required to access or perform specific operations on the file or directory. For bit values, see File and Directory Access Rights Constants.
Windows Me/98/95 on Windows 98/95 FAT volumes, AccessMask:  On Windows 98/95 FAT volumes, AccessMask is null.
AllowMaximum
Data type: boolean
Access type: Read-only

Number of concurrent users for this resource has been limited. If true, the value in the MaximumAllowed property is ignored.

Caption
Data type: string
Access type: Read-only

Short description of the object.

Description
Data type: string
Access type: Read-only

Description of the object.

InstallDate
Data type: datetime
Access type: Read-only

Object was installed. This property does not need a value to indicate that the object is installed.

MaximumAllowed
Data type: uint32
Access type: Read-only

Limit on the maximum number of users allowed to use this resource concurrently. The value is only valid if the AllowMaximum property is set to FALSE.

Name
Data type: string
Access type: Read-only
Qualifiers: Key

Alias given to a path set up as a share on a computer system running Windows.

Example: "public"

Path
Data type: string
Access type: Read-only

Local path of the Windows share.

Example: "C:\Program Files"

Status
Data type: string
Access type: Read-only

Current status of the object. Various operational and nonoperational statuses can be defined. Operational statuses include: "OK", "Degraded", and "Pred Fail" (an element, such as a SMART-enabled hard disk drive, may be functioning properly but predicting a failure in the near future). Nonoperational statuses include: "Error", "Starting", "Stopping", and "Service". The latter, "Service", could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is online, yet the managed element is neither "OK" nor in one of the other states.

The values are:

"OK"
"Error"
"Degraded"
"Unknown"
"Pred Fail"
"Starting"
"Stopping"
"Service"
"Stressed"
"Nonrecover"
"NoContact"
"LostComm"
Type
Data type: uint32
Access type: Read-only

Type of resource being shared. Types include: disk drives, print queues, interprocess communications (IPC), and general devices.

ValueMeaning
0 (0x0)

Disk Drive

1 (0x1)

Print Queue

2 (0x2)

Device

3 (0x3)

IPC

2147483648 (0x80000000)

Disk Drive Admin

2147483649 (0x80000001)

Print Queue Admin

2147483650 (0x80000002)

Device Admin

2147483651 (0x80000003)

IPC Admin

 

Remarks

The Win32_Share class is derived from CIM_LogicalElement.

Examples

For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.

For C++ code examples, see WMI C++ Application Examples.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Namespace

\root\CIMV2

MOF

Cimwin32.mof

DLL

Cimwin32.dll

See also

Operating System Classes

 

 

Send comments about this topic to Microsoft

Build date: 11/19/2012

Community Additions

ADD
© 2013 Microsoft. All rights reserved.