How do I use RunLevel and Configure For when creating a task? #886
-
Hello, I am new to this forum and I apologize if this topic has been mentioned before. I created some code in vb.net and I was successful in using the TaskScheduler library to create a task. Here is my code.
Here's the error I receive: An unhandled exception of type 'System.UnauthorizedAccessException' occurred in Microsoft.Win32.TaskScheduler.dll Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
RunLevel Configured for |
Beta Was this translation helpful? Give feedback.
-
Hi David,
Thank you for the information. Unfortunately, I'm not sure what to do at
this point.
My code is for my personal use but I intend to use it on many servers. I do
not know the credentials that will be used to run the task.
Currently, I have XML files that I import. Once imported, I have to adjust
each task for certain settings. The IT manager is responsible to select to
Run whether logged in or not and use appropriate credentials to run the
task.
…On Thu, May 20, 2021 at 12:34 PM David Hall ***@***.***> wrote:
The default parameters for RegisterTaskDefinition have it run as the
currently executing user, which could be one without privileges. See the
documentation for the underlying COM object here
<https://docs.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-iprincipal-put_runlevel>
to understand the security requirements associated with the property. You
may be required to specify an account depending on your scenario.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#886 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJPNPWIMCUSLWUVZHIELWA3TOU22LANCNFSM45GXUTAQ>
.
--
Thank you,
*James Dumont*
Application Engineer
*MicroCAD Training & Consulting*
*Direct:* 617-321-2415 *Toll Free:* 888-355-0081
*Certified MBE and DBE*
Reality Capture <https://www.microcad3d.com/scanning-services> | Software
<https://www.microcad3d.com/#products> | HP Plotters
<https://www.microcad3d.com/hp-printers/> | BIM Services
<https://www.microcad3d.com/#services> | Training
<https://www.microcad3d.com/class-schedule/>
Follow us on: Facebook
<https://www.facebook.com/microcadtrainingandconsulting> | Youtube
<https://www.youtube.com/MicroCAD3D> | LinkedIn
<https://www.linkedin.com/company/microcad-training-&-consulting> | Twitter
<https://twitter.com/MicroCAD3d>
|
Beta Was this translation helpful? Give feedback.
-
Hi Dahall/Taskscheduler,
I'll look into the settings that you provided.
Thanks for the response.
…On Tue, Sep 28, 2021 at 1:03 PM matthew-mayer ***@***.***> wrote:
Did you find a solution to this?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#886 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJPNPWIQ3SS6IWJPFSK2SX3UEHYM3ANCNFSM45GXUTAQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
*James Dumont*
*MicroCAD Training & Consulting*
*Direct:* 617-321-2415 *Toll Free:* 888-355-0081
|
Beta Was this translation helpful? Give feedback.
RunLevel
The default parameters for
RegisterTaskDefinition
have it run as the currently executing user, which could be one without privileges. See the documentation for the underlying COM object here to understand the security requirements associated with the property. You may be required to specify an account depending on your scenario.Configured for
TaskDefinition.Settings.Compatibility
is the property that represents the "Configure for" item in the UI. See the documentation for each of those enum values to understand how they translate to OS versions.