Skip to content

Latest commit

 

History

History
79 lines (46 loc) · 2.17 KB

logontrigger-userid.md

File metadata and controls

79 lines (46 loc) · 2.17 KB
title description ms.assetid keywords topic_type api_name api_location api_type ms.topic ms.date
LogonTrigger.UserId property
For scripting, gets or sets the identifier of the user.
d28eea9b-8238-49e7-afec-5a96281b3063
UserId property Task Scheduler
UserId property Task Scheduler , LogonTrigger object
LogonTrigger object Task Scheduler , UserId property
apiref
LogonTrigger.UserId
taskschd.dll
COM
reference
05/31/2018

LogonTrigger.UserId property

For scripting, gets or sets the identifier of the user.

Syntax

LogonTrigger.UserId As String

Property value

The identifier of the user. For example, "MyDomain\MyName" or for a local account, "Administrator".

This property can be in one of the following formats:

  • User name or SID: The task is started when the user logs on to the computer.
  • NULL: The task is started when any user logs on to the computer.

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 LogonTrigger.UserId property. Instead, create a logon trigger with an empty LogonTrigger.UserId property and assign a value to the principal for the task using the Principal.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]
Type library
Taskschd.tlb
DLL
Taskschd.dll

See also

LogonTrigger

Task Scheduler