GithubHelp home page GithubHelp logo

Comments (10)

mkellerman avatar mkellerman commented on September 26, 2024

Working on a fix, seems a parameter was not renamed correctly.

from invoke-commandas.

mkellerman avatar mkellerman commented on September 26, 2024

Should be fixed in #38
Merging now, and publishing new release.
Can you please confirm that this fixed the issue for you?

from invoke-commandas.

mkellerman avatar mkellerman commented on September 26, 2024

3.1.6 is now in PSGallery

from invoke-commandas.

adstep avatar adstep commented on September 26, 2024

Seeing an error now:

PS C:\windows\system32> Invoke-CommandAs -ScriptBlock { whoami } -AsUser $cred
Invoke-ScheduledTask : An error occurred while registering scheduled job definition
e60d4e36-5ace-49e7-a6b0-144db629961d to the Windows Task Scheduler.  The Task Scheduler error is: (32,4):UserId:.
At C:\Program Files\WindowsPowerShell\Modules\Invoke-CommandAs\3.1.6\public\Invoke-CommandAs.ps1:399 char:17
+                 Invoke-ScheduledTask @Parameters
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-ScheduledTask

from invoke-commandas.

mkellerman avatar mkellerman commented on September 26, 2024

Does the user have access to running scheduled tasks? create one manually in Task Schedule, and confirm please.

from invoke-commandas.

adstep avatar adstep commented on September 26, 2024

Yes, the user has permissions on the box. They are an Administrator. I was able to create a task.

from invoke-commandas.

mkellerman avatar mkellerman commented on September 26, 2024

Thanks for testing. Will investigate more tonight and get back to you.

from invoke-commandas.

adstep avatar adstep commented on September 26, 2024

It looks like this stack overflow post is talking about a similar issue to what I'm seeing. Doesn't look like they reach a resolution :(

from invoke-commandas.

adstep avatar adstep commented on September 26, 2024

Hey Marc, I was recently came back to the issue and was able to figure out what was going wrong with my use case. Apparently you can't create a schedule job if you are running as system. Our workaround has been to create a temporary user to register the job and then clean it up afterwards. I've created a PR to apply the workaround (#46.)

from invoke-commandas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.