Cant Find "New-ScheduledTaskSettingsSet" cmdlet

Hi All,

A quick help required. I cannot find the New-ScheduledTaskSettingsSet in the taskscheduler module which i installed using the cmdlet install-module. This is required to change the default priority of all the task in the task scheduler to normal.
How can i get this cmdlet.

Background

We have datastage installed in a windows 2008 R2 Sp1 machine running powershell v2. If we have created a manual task (task version 1.2 )in task scheduler we can edit the xml file to change the priority of the task to normal (5).
In my case the task is created using IBM infosphere datastage and quality stage director and user is facing performance issue while running the jobs on schedule and user is asking us to change the priority of the task to normal. Since its task version is (1.0) we are not seeing option priority in the XMl file.
here we require the cmdlet New-ScheduledTaskSettingsSet
So that we can run
PS C:> $STSet = New-ScheduledTaskSettingsSet -Priority 5
PS C:> Set-ScheduledTask -TaskName “My Task” -Settings $STSet

The scheduled task cmdlets were introduced with PowerShell version 3 on Windows 8/Server 2012.

You could try updating the Windows Management Framework to a later version, which will install a newer version of PowerShell. However, bear in mind that some modules/cmdlets also require the support of the underlying operating system. If the module requires features that are not available in 2008 R2 then you’ll need to upgrade the OS to get full functionality.

I have checked in win2012 but the specific cmdlet New-ScheduledTaskSettingsSet is not found in the module taskscheduler.
Please see the output in the Windows 2012 r2
PS C:\Users\Administrator> Get-Command -Module taskscheduler

CommandType Name ModuleName


Function Add-TaskAction taskscheduler
Function Add-TaskTrigger taskscheduler
Function Connect-ToTaskScheduler taskscheduler
Function Get-RunningTask taskscheduler
Function Get-ScheduledTask taskscheduler
Function New-Task taskscheduler
Function Register-ScheduledTask taskscheduler
Function Remove-Task taskscheduler
Function Start-Task taskscheduler
Function Stop-Task taskscheduler

PS C:\Users\Administrator> $psversiontable

Name Value


PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.34003
BuildVersion 6.3.9600.16394
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2

PS C:\Users\Administrator> Get-CimInstance win32_operatingsystem

SystemDirectory Organization BuildNumber RegisteredUser SerialNumber Version


C:\Windows\system32 9600 Windows User 00253-50000-0000… 6.3.9600

The module is ScheduledTasks not TaskScheduler

PS C:\Users\Administrator> Get-Command New-ScheduledTaskSettingsSet

CommandType     Name                                               ModuleName
-----------     ----                                               ----------
Function        New-ScheduledTaskSettingsSet                       ScheduledTasks

As far as I can tell from a cursory search, the TaskScheduler module is a downloaded module, not part of the OS.

Thanks Matt for your reply…some how i managed to execute the command but its not working perfectly in windows 2008 R2

As far as I know the capabilities of Powershell even depend on the underliing operating system. Even if you update to the latest available version of Powershell - some of the features you will only get with a newer Windows underneath. So you might look for another solution for the task you have to do. Did you try to use the commandline version of the task scheduler “schtasks.exe”? It’s even able to import prepared xml files to create scheduled tasks.

Hi Olaf ,
Thanks for the reply. I checked the syntax for schtasks.exe but the option for changing the priority is not there.