SetSecurityDescriptor Method of the Win32_LogicalShareSecuritySetting Class

The SetSecurityDescriptorWMI 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

MOF
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 table. For more information, see WMI Return Codes.

Return codeDescription
0

Successful completion.

2

The user does not have access to the requested information.

8

Unknown failure.

9

The user does not have adequate privileges.

21

The specified parameter is invalid.

 

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.

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 clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
MOFSecrcw32.mof
DLLCimwin32.dll
Namespace\root\cimv2

See Also

Operating System Classes
Win32_LogicalShareSecuritySetting
WMI Security Descriptor Objects
Win32_SecurityDescriptor
Maintaining WMI Security

Send comments about this topic to Microsoft

Build date: 11/3/2009

Tags :


Page view tracker