Hey,
I try to create a scheduledtask using powershell on Windows 7 SP1 machine.
Command look like:
$A = New-ScheduledTaskAction –Execute $Command $S = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -DontStopOnIdleEnd -Hidden -Priority 9 $Task = Register-ScheduledTask -TaskName $TaskName -Action $A -User $RunAsUser -CimSession $CompName -RunLevel Highest -Settings $S -Forc
But on last command I receive the following error:
Register-ScheduledTask : The WS-Management service cannot process the request. The CIM namespace Root/Microsoft/Windows/TaskScheduler is invalid.
Running the same command on Windows 8.1 everything is okay.
Having a look at both devices I can see that the WMI namespace on Win 8.1 is available but not on windows 7 SP1.
How is the procedure to get this namespace?
Windows Management Framework 4.0 is already installed on the Windows 7 SP1 machine.