GetAccessMask method of the Win32_Share class
The GetAccessMask method returns a uint32 bitmap with the access rights to the share held by the user or group on whose behalf the instance is returned.
This topic uses Managed Object Format (MOF) syntax. For more information about using this method, see Calling a Method.
Syntax
uint32 GetAccessMask();
Parameters
This method has no parameters.
Return value
| Value (const/dec/hex) | Description |
|---|---|
|
Grants the right to read data from the file. For a directory, this value grants the right to list the contents of the directory. |
|
Grants the right to write data to the file. For a directory, this value grants the right to create a file in the directory. |
|
Grants the right to append data to the file. For a directory, this value grants the right to create a subdirectory. |
|
Grants the right to read extended attributes. |
|
Grants the right to write extended attributes. |
|
Grants the right to execute a file. For a directory, the directory can be traversed. |
|
Grants the right to delete a directory and all of the files it contains (its children), even if the files are read-only. |
|
Grants the right to read file attributes. |
|
Grants the right to change file attributes. |
|
Grants delete access. |
|
Grants read access to the security descriptor and owner. |
|
Grants write access to the discretionary access control list (DACL). |
|
Assigns the write owner. |
|
Synchronizes access and allows a process to wait for an object to enter the signaled state. |
Examples
For more information and script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.
For more information and C++ code examples, see WMI C++ Application Examples.
The following VBScript code example creates a share folder and then gets the value of the access mask in the security descriptor that secures the share folder.
strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer _ & "\root\cimv2") Set objNewShare = objWMIService.Get("Win32_Share") Return = objNewShare.Create _ ("C:\Temp", "TestShare", FILE_SHARE, _ MAXIMUM_CONNECTIONS, "test share") If Return <> 0 Then WScript.Echo Return WScript.Quit End If Set objShare = objWMIService.Get("Win32_Share.Name='TestShare'") Return = objShare.GetAccessMask WScript.Echo Return
Requirements
|
Minimum supported client | Windows XP [desktop apps only] |
|---|---|
|
Minimum supported server | Windows Server 2003 [desktop apps only] |
|
Namespace |
\root\CIMV2 |
|
MOF |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 11/19/2012
