Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scheduled Tasks

Status
Not open for further replies.

jiska1974

IS-IT--Management
Jan 21, 2015
1
AU
This has been doing my head in for two days. I'm hoping someone here might be able to point me in the right direction.

All I want to do is list all of the Scheduled Tasks in the root tasks folder and display 1/ the task name and 2/ the account under which the task runs. I've been able to achieve (1) pretty easily, but I cannot for the life of me work out how to pull out the account the task is run out.

I've been here: and the "Principal.Userid" is the field I'm after (I think) but I cannot work out how to call that within the script below.

Does anyone have any ideas??

Set service = CreateObject("Schedule.Service")
Call service.Connect()
Set rootFolder = service.GetFolder("\")
Set taskCollection = rootFolder.GetTasks(0)

For Each Task In taskCollection
wscript.echo Task.Name
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top