<p>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.</p>

[{'answer_id': 33805, 'author': 'PabloG', 'author_id': 394, 'author_profile': 'https://Stackoverflow.com/users/394', 'pm_score': 1, 'selected': False, 'text': '<p>You don\'t need PowerShell to automate the Task Scheduler, you can use the SCHTASKS command in XP.</p>\n\n<p>According to <a href="http://en.wikipedia.org/wiki/Task_Scheduler" rel="nofollow noreferrer">Wikipedia</a>, the Task Scheduler 2.0 (Vista and Server 2008) is accesible via COM.</p>\n'}, {'answer_id': 33806, 'author': 'Matt Hamilton', 'author_id': 615, 'author_profile': 'https://Stackoverflow.com/users/615', 'pm_score': 0, 'selected': False, 'text': '<p>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.</p>\n'}, {'answer_id': 33817, 'author': 'Matt Hamilton', 'author_id': 615, 'author_profile': 'https://Stackoverflow.com/users/615', 'pm_score': 2, 'selected': False, 'text': '<p>Ok, Pablo has sparked my interest in saying that the scheduler is accessible via COM.</p>\n\n<p>In PowerShell you can do this:</p>\n\n<pre><code>$svc = new-object -com Schedule.Service\n</code></pre>\n\n<p>... and that gives you a handle to the task scheduler. You can see what members it has using:</p>\n\n<pre><code>$svc | get-member\n</code></pre>\n\n<p>One of its methods is NewTask, so I\'d start there.</p>\n\n<p>Edit: Some more info <a href="http://msdn.microsoft.com/en-us/library/aa446862.aspx" rel="nofollow noreferrer">here</a>. It\'s a VBScript example but it\'ll give you the gist.</p>\n'}, {'answer_id': 40695, 'author': 'EBGreen', 'author_id': 1358, 'author_profile': 'https://Stackoverflow.com/users/1358', 'pm_score': 1, 'selected': False, 'text': '<p><a href="http://myitforum.com/cs2/blogs/yli628/archive/2008/07/28/powershell-script-to-retrieve-scheduled-tasks-on-a-remote-machine-task-scheduler-api.aspx" rel="nofollow noreferrer">This</a> is a good article (be sure to read the other linked article in it) that discusses looking at th scheduled tasks on remote machines. It is not exactly what you were asking for but it should get you headed in the right direction.</p>\n'}, {'answer_id': 51716, 'author': 'PabloG', 'author_id': 394, 'author_profile': 'https://Stackoverflow.com/users/394', 'pm_score': -1, 'selected': False, 'text': '<p>@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?\nLike 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.</p>\n'}]
['https://Stackoverflow.com/questions/33779', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1635/']