VMware Aria Automation Orchestrator

 View Only
  • 1.  create a new Scheduled Tasks from VRO to my VC

    Posted Feb 12, 2025 10:14 AM

    hi 
    I need to create a Scheduled Tasks from VRO to my VC
    this is the example record from my VC 
    I need to know how to start to build the in on  Scriptable task ? 

    #---------------CreateScheduledTask---------------
    $entity = New-Object VMware.Vim.ManagedObjectReference
    $entity.Type = 'VirtualMachine'
    $entity.Value = 'vm-2258822'
    $spec = New-Object VMware.Vim.ScheduledTaskSpec
    $spec.Scheduler = New-Object VMware.Vim.OnceTaskScheduler
    $spec.Scheduler.RunAt = [System.DateTime]::Parse('02/11/2025 09:39:00')
    $spec.Notification = ''
    $spec.Name = 'MYVMTest001 - Delete Snapshots'
    $spec.Action = New-Object VMware.Vim.MethodAction
    $spec.Action.Argument = New-Object VMware.Vim.MethodActionArgument[] (2)
    $spec.Action.Argument[0] = New-Object VMware.Vim.MethodActionArgument
    $spec.Action.Argument[1] = New-Object VMware.Vim.MethodActionArgument
    $spec.Action.Argument[1].Value = New-Object VMware.Vim.SnapshotSelectionSpec
    $spec.Action.Argument[1].Value.RetentionDays = 3
    $spec.Action.Name = RemoveAllSnapshots_Task
    $spec.Description = 'des kuku'
    $spec.Enabled = $true
    $_this = Get-View -Id 'ScheduledTaskManager-ScheduledTaskManager'
    $_this.CreateScheduledTask($entity, $spec)




  • 2.  RE: create a new Scheduled Tasks from VRO to my VC

    Posted Feb 12, 2025 05:00 PM

    You can export it as a Javascript instead of Powershell. Can you try and see if it solves your problem?



    ------------------------------
    If you find the answer helpful, please click on the RECOMMEND button.

    Please visit my blog to get more information: https://www.clouddepth.com
    ------------------------------