ILogonTrigger::get_UserId method (taskschd.h)

Gets or sets the identifier of the user.

This property is read/write.

Syntax

HRESULT get_UserId(
  BSTR *pUser
);

Parameters

pUser

Return value

None

Remarks

If you want a task to be triggered when any member of a group logs on to the computer rather than when a specific user logs on, then do not assign a value to the UserId property. Instead, create a logon trigger with an empty UserId property and assign a value to the principal for the task using the GroupId property.

When reading or writing XML for a task, the logon user identifier is specified using the UserId element of the Task Scheduler schema.

Requirements

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

See also

ILogonTrigger

Task Scheduler