Condividi tramite


SetSecurityDescriptor method of the Win32_LogicalShareSecuritySetting class

The SetSecurityDescriptor WMI class method sets a security descriptor to a specified structure.

This topic uses Managed Object Format (MOF) syntax. For more information about using this method, see Calling a Method.

Syntax

uint32 SetSecurityDescriptor(
  [in] Win32_SecurityDescriptor Descriptor
);

Parameters

Descriptor [in]

An expression that resolves to an instance of a Win32_SecurityDescriptor.

Return value

The SetSecurityDescriptor method can return the error codes listed in the following list. For more information, see WMI Return Codes.

Success

0

Successful completion.

Access denied

2

The user does not have access to the requested information.

Unknown failure

8

Unknown failure.

Privilege missing

9

The user does not have adequate privileges.

Invalid parameter

21

The specified parameter is not valid.

Other

22 4294967295

Remarks

For a VBScript code example of how to get the security descriptor, change it, and write it back, see SetSecurityDescriptor Method in Class Win32_LogicalFileSecuritySetting.

The SeSecurityPrivilege privilege is required to execute this method. For more information, see Executing Privileged Operations.

When a new security access control list (SACL) is not specified in a call to a SetSecurityDescriptor method, then the security descriptor SACL on the target securable object is set to NULL so that the previous SACL setting does not persist.

Requirements

Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Namespace
Root\CIMv2
MOF
Secrcw32.mof
DLL
CIMWin32.dll

See also

Operating System Classes

Win32_LogicalShareSecuritySetting

WMI Security Descriptor Objects

Win32_SecurityDescriptor

Maintaining WMI Security