Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Create a Scheduler Task from Automation

Solved555 views19th December 2024Automation C++ Documentation Scheduler Scheduler Task
3
David Rid [DevOps Enabler]628 6th December 2024 0 Comments

Hi, I’m looking for a way to create a scheduled task in an automation script. The NuGet package apparently cannot be found in Visual Studio. Is this outdated?

“Skyline.DataMiner.Core.Scheduler.Automation”

https://docs.dataminer.services/develop/devguide/ClassLibrary/ClassLibraryScheduler.html#installing-the-scheduler-nuget-package

Thank you!

David Rid [DevOps Enabler] Selected answer as best 19th December 2024

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
0
Robin Spruytte [SLC] [DevOps Advocate]647 Posted 12th December 2024 4 Comments

Using the IDmsScheduler from the Skyline.DataMiner.Core.DataMinerSystem.Common nuget, you can create and schedule your tasks in the Task Scheduler.

David Crome Posted new comment 10th March 2025
David Rid [DevOps Enabler] commented 12th December 2024

Thank you! The documentation helped me. With minor modifications, I was able to make it run in an automation script.

private void RunSafe(IEngine engine)
{
var dms = engine.GetDms();
var dma = dms.GetAgent(Engine.SLNetRaw.ServerDetails.AgentID);
var scheduler = dma.Scheduler;

DateTime startDate = DateTime.Now.AddMinutes(1);
DateTime endDate = DateTime.Now.AddMinutes(2);

string activStartDay = startDate.ToString("yyyy-MM-dd");
string activStopDay = endDate.ToString("yyyy-MM-dd");

string startTime = startDate.ToString("HH:mm:ss");
string endTime = endDate.ToString("HH:mm:ss");

string taskType = "once"; // Task type (1=once , 2=weekly, 3=monthly, 4=daily)
string runInterval = "1"; // Run interval (x minutes(daily) / 1,…,31,101,102(monthly) / 1,3,5,7 (1=Monday, 7=Sunday)(weekly))

string scriptName = "scriptName";
string elemLinked = ""; //"PROTOCOL:1:123:456", // example of linking element 123/456 to script dummy 1
string paramLinked = "";
string taskName = "SchedulerCreateTaskTest";
string taskDescription = "Task description";

object[] schedulerTaskData = new object[] {
new object[] {
new string[] // general info
{
taskName, // [0] : name
activStartDay, // [1] : start date (YYYY-MM-DD) (leave empty to have start time == current time)
activStopDay, // [2] : end date (YYYY-MM-DD) (can be left empty)
startTime, // [3] : start run time (HH:MM)
taskType, // [4] : task type (daily / monthly / weekly / once)
runInterval, // [5] : run interval (x minutes / 1,…,31,101,102 / 1,3,5,7 (1=Monday, 7=Sunday)) (101-112 -> months)
"", // [6] : # of repeats before final actions are executed
taskDescription, // [7] : description
"TRUE", // [8] : enabled (TRUE/FALSE)
endTime, // [9] : end run time (HH:MM) (only affects daily tasks)
"", // [10]: minutes interval for weekly/monthly tasks. Either an end date or a repeat count should be specified
}
},
new object[] // repeat actions
{
new string[] {
"automation", // action type
scriptName, // name of automation script
elemLinked, // example of linking element 123/456 to script dummy 1
paramLinked, // … other options & further linking of dummies to elements can be added
// elem2Linked,
"CHECKSETS:FALSE",
"DEFER:False", // run sync
}
},
new object[] {} // final actions
};
scheduler.CreateTask(schedulerTaskData);
}

David Crome commented 7th March 2025

The above example works, but using the API with specific domain classes looks way better:
https://docs.dataminer.services/develop/devguide/ClassLibrary/ClassLibraryScheduler.html#defining-the-task-recurrence

But I can not find any of the classes mentioned above. I tried to use

var scheduleOnce = new ScheduleOnce(createSchedulerEvent: true);

but the class ScheduleOnce does not exists even when I added all necessary NuGet packages. And as @David Rid already described, the NuGet package for the Scheduler is not available with

Install-Package Skyline.DataMiner.Core.Scheduler.Automation

Which NuGet package do I need to install?

David Rid [DevOps Enabler] commented 10th March 2025

I went ahead with the solution I mentioned earlier, and it's still running without any issues so far. I used it as a base, not only for creating tasks but also to create events in the scheduler. If you're looking to clean up the code, consider creating your own scheduling function or method that accepts arguments, offering more flexibility.

At the moment, I haven't come across any other solutions. While it's not the most elegant approach, do you think it would work for your use case?

David Crome commented 10th March 2025

Yes that works, I already using it. But I would like to use the scheduler task classes like in the docs described. Using object arrays is not a good solution and if they provide a API for that I want to use it.
I will create a new question to address this issue.

1
Miguel Obregon [SLC] [DevOps Catalyst]19.12K Posted 6th December 2024 0 Comments

Hi David,

There is already a similar question:

automation – create schedule tasks

Hope it helps.

Miguel Obregon [SLC] [DevOps Catalyst] Answered question 6th December 2024
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs