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