IPrincipal2::AddRequiredPrivilege method (taskschd.h)

Adds the required privilege to the task process token.

Syntax

HRESULT AddRequiredPrivilege(
  [in] BSTR privilege
);

Parameters

[in] privilege

Specifies the right of a task to perform various system-related operations, such as shutting down the system, loading device drivers, or changing the system time.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header taskschd.h
Library Taskschd.lib
DLL Taskschd.dll

See also

IPrincipal2

Task Scheduler