Does anyone know of a powershell cmdlet out there for automating task scheduler in XP/2003? If you've ever tried to work w/ schtasks you know it's pretty painful.
Not "native" PowerShell, but if you're running powershell.exe as an administrator then you should have access to the "at" command, which you can use to schedule tasks.
Ok, Pablo has sparked my interest in saying that the scheduler is accessible via COM.
In PowerShell you can do this:
$svc = new-object -com Schedule.Service
... and that gives you a handle to the task scheduler. You can see what members it has using:
$svc | get-member
One of its methods is NewTask, so I'd start there.
Edit: Some more info here. It's a VBScript example but it'll give you the gist.
@(EBGreen) Win32_ScheduledJob class only works with at-scheduled jobs.
The other solution using the com object Schedule.Service is also not an option for 2003
the question is can we use script, PowerShell in particular to retrieve the tasks scheduled using Task Scheduler API? Yes, we can! But you will need Windows Vista to accomplish that.
cheers
@slipsec: I don't have access to a 2003 server to try, but googling "2003 server" SCHTASKS there are links related to questions about it. Perhaps you misspell the command? Like Matt says, you also can use AT, but in this case you don't have access to the scheduled tasks via the Control Panel, only via the AT command.