Importing Scheduled Task using Powershell
Today's topic? Powershell and Scheduled Tasks! Powershell provides a much more friendlier way to interact with scheduled task using the ScheduledTask module than the sc.exe does, but lets go through the cmdlets in that module. First we have the Enable/Disable-ScheduledTask that are used in order to enable or disable a task. Then there are the Start/Stop-ScheduledTask that start or stop a task when it's running. We can use the Register/UnRegister-ScheduledTask in order to add or remove a task and Export-ScheduledTask in order to export a task to an XML file. Let me add a command that I find very useful when it comes to importing tasks from a file here: Register-ScheduledTask -Xml ( Get-Content 'C:\Temp\MyTask.xml' | Out-String ) ` -TaskName "MyTask" ` -User 'user' ` -Password 'password' – Force First we get the content of the MyTask.xml file and then we regist...