New-ScheduledTaskPrincipal : Invalid class
At C:\Program Files\WindowsPowerShell\Modules\Invoke-CommandAs\3.1.6\private\Invoke-ScheduledTask.ps1:91 char:56
Invoke-ScheduledTask : Cannot validate argument on parameter 'Principal'. The argument is null or empty. Provide an
argument that is not null or empty, and then try the command again.
At C:\Program Files\WindowsPowerShell\Modules\Invoke-CommandAs\3.1.6\public\Invoke-CommandAs.ps1:399 char:17
Hello,
I have a issue on 2012 R2 ENG :
PS C:\Users\Administrator> Invoke-CommandAs -ScriptBlock { Get-Process } -AsSystem New-ScheduledTaskAction : Invalid class At C:\Program Files\WindowsPowerShell\Modules\Invoke-CommandAs\3.1.6\private\Invoke-ScheduledTask.ps1:89 char:49
New-ScheduledTaskPrincipal : Invalid class At C:\Program Files\WindowsPowerShell\Modules\Invoke-CommandAs\3.1.6\private\Invoke-ScheduledTask.ps1:91 char:56
Invoke-ScheduledTask : Cannot validate argument on parameter 'Principal'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Program Files\WindowsPowerShell\Modules\Invoke-CommandAs\3.1.6\public\Invoke-CommandAs.ps1:399 char:17
The version of powershell is 5.1
Thank for your help.