Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8349869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:08:14+00:00 2026-06-09T08:08:14+00:00

I’ve run into a small problem with a script I’ve been working on. The

  • 0

I’ve run into a small problem with a script I’ve been working on.

The code itself works perfectly fine; when I run it on my local workstation, it’s perfect. However, when I run it on one of the servers (Win 2003 R2 32-bit) that need SCCM installed on it (which this script is designed to automatically install) it fails in one of my functions. Relevent code follows:

    # Schedules Weekly tasks
    function SchWeekly
    {param ([string]$Comp, [string]$Date, [string]$RunTime, [int]$DayOfWeek, [string]        $commandpath)

    $service = new-object -comobject "Schedule.Service"             # Forms object reference
    $service.Connect($Comp)                                         # Connects to host machine
    $rootFolder = $service.GetFolder("\")                       # Sets root folder of Task Scheduler
    $taskDefinition = $service.NewTask(0)                           # Begins task creation
    $regInfo = $taskDefinition.RegistrationInfo                     # Sets registry info
    $regInfo.Description = 'SCCM Check For Update'
    $regInfo.Author = "Administrator"
    $settings=$taskDefinition.Settings                              # Sets default settings for the new task
    $settings.StartWhenAvailable = $True
    $settings.Hidden = $False
    $triggers = $taskDefinition.Triggers                            # Creates Trigger object reference
    $trigger = $triggers.Create(3)                                  # Sets to create (Number 3 means Weekly trigger)
    # Start Time ex. 2012-6-10 22:00:00
    $trigger.StartBoundary = $Date + "T" + $RunTime                 # Sets start date (End date can be set) e
                                                            # ex. $trigger.EndBoundary = Date + "T" + Time
    $trigger.DaysOfWeek = $DayOfWeek                                # Sends integer for day of week to run on (1-7)
                                                            # 1 = Sunday, 2 = Monday, etc....
    $trigger.WeeksInterval = 1                                      # Sets to run every week
    $trigger.Id = "WeeklyTriggerId"                                 # Trigger ID name
    $trigger.Enabled = $True
    $Action = $taskDefinition.Actions.Create(0)
    $Action.Path = $commandpath                                         # Links to script
    $rootFolder.RegisterTaskDefinition('SCCM Check For Update', $taskDefinition, 6, "", "", 3)  # Registers scheduled task
    }

The error specifically is on this line:
$service = new-object -comobject “Schedule.Service”

It reports that “Cannot load COM type Schedule.Service”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T08:08:15+00:00Added an answer on June 9, 2026 at 8:08 am

    The reason is your local box is widows 7 server 2003 does not have the comobject “Schedule.Service” it is part of windows 7 and 2008.

    If you follow the link below it will show you how to schedule a task on a windows 2003 server using powershell.

    Schedules tasks on w2k3

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am currently running into a problem where an element is coming back from
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I would like to run a str_replace or preg_replace which looks for certain words
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.