Comments (10)
Working on a fix, seems a parameter was not renamed correctly.
from invoke-commandas.
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.
3.1.6 is now in PSGallery
from invoke-commandas.
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.
Does the user have access to running scheduled tasks? create one manually in Task Schedule, and confirm please.
from invoke-commandas.
Yes, the user has permissions on the box. They are an Administrator. I was able to create a task.
from invoke-commandas.
Thanks for testing. Will investigate more tonight and get back to you.
from invoke-commandas.
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.
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)
- Access is denied. on localhost HOT 6
- Unable to invoke command as gMSA - v3.1.2 HOT 11
- Access Denied with -RunElevated HOT 3
- Removing entries from the Task Scheduler log HOT 3
- $Using: variable preface not respected HOT 6
- Module on Powershell Core HOT 2
- Erro running RunElevated parameter HOT 4
- Support for PowerShell 7 HOT 12
- PowerShell Core Compatiblility HOT 2
- Not working when using variables in script block HOT 3
- Can't figure out the right amount of permission HOT 2
- Unable to submit credential objects as arguments HOT 6
- AsSystem doesn't seem to execute while device is on battery power HOT 4
- Would it be possible to run -AsLocalService HOT 1
- Invoke-CommandAs -AsSystem broke on 2012 R2 ENG
- Add support for Network Service HOT 1
- Add tagging to Azure pipeline for releases HOT 2
- parsing error when using -FilePath HOT 3
- Calling via NT Authority\SYSTEM - requires elevation? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from invoke-commandas.