Configure Timerjobs Script for SharePoint Server UCC changes

Timer jobs were a native feature of SharePoint Server but has never been made available by Microsoft on SharePoint Online (Learn More - Microsoft). Microsoft has other native tools available to accomplish these tasks, more on that later. The AnywhereNow Timerjobs, as visible in the Ucc.Creator "Timerjobs" menu, were once developed to hook into this native SharePoint Server timer job service (Classic timer jobs). With the advent and increased adoption of SharePoint Online by our customers and to ensure identical experience across both SharePoint eco-systems, AnywhereNow recreated the functionality as a Powershell script, to be executed as a scheduled task, every five minutes, per , from a separate, always-on, Windows management server.

As AnywhereNow, and Microsoft, and our customers are moving to cloud-only solutions, many customers have no management server(s) anymore, thus the model of running a PowerShell script as a Windows server Scheduled Task has become an unfeasible solution. These last years, Dialogue Cloud has hosted these scripts as a service for our initial Dialogue Cloud customers, but as our number of customers grew and as Microsoft's service limits change (Learn More - Microsoft) it faced increasingly frequent by Microsoft 365 (Dialogue Cloud Timerjob scripts connected to all customer's SharePoint sites, per UCC, every 5 minutes, 24/7). And being throttled directly stops the proper working and intended use of Timerjobs. AnywhereNow therefore cannot further support the timerjob back-end from Dialogue Cloud. The AnywhereNow Timerjob menu in your Ucc.Creator SharePoint interface, will therefore not be functional anymore, and will be removed from the Ucc.Creator template in a future update.

Fortunately Microsoft 365 has a native alternative for automating repetitive tasks across an increasing number of their cloud services (including SharePoint Online) called Power Automate, initially known as Microsoft Flow (Learn More - Microsoft). Power Automate can accomplish all tasks (i.e. in AnywhereNow terms, change, add or clear a value of a specific field in any SharePoint list or library at a specific time or regular scheduled interval) that the AnywhereNow Timerjobs would be able to do. All in your own tenant, under your full control using your resources.

Getting acquainted with the power of Power Automate may require some adjustment in thinking about SharePoint Lists, Fields and Values but we see this is being quickly adopted. Else, reach out to your AnywhereNow Certified Partner who are glad to help you with your Power Automates.
For your convenience we have provided several examples of Power Automate flows for what we think are typical use cases, but an infinite amount of variations may be more applicable to you.

Examples can be found on: Automate SharePoint (Timerjob replacements)

Note

For SharePoint Online (and the SharePoint Template 6.0 or higher), the Timerjob replacement with Microsoft Power Automate should be used . See: Microsoft Power Automate to schedule updates to the Welcome Message

Below instructions are only suitable for SharePoint Server deployments. Running frequent repetitive remote Powershell scripts against SharePoint Online are increasingly running into throttling thresholds of Microsoft 365.

Configure the AnywhereNow Timerjob Script as server scheduled task

Note

These steps are for SharePoint Server only using the authentication methods mentioned below.

  1. Grab the site URL (parent site of your ucc) and client secret

    Example: https://contoso.sharepointserver.com/sites/ucc/ucc_support/(only use bold part)

    Note

    This is also the site for the UCC Creator.

  2. Copy the contents of the timerjobs scripts to e.g. <drive>\program files\anywhere365\scripts\SP_Timerjobs on the UCC server.

    Note

    The Timerjobs scrips can be requested at the support-desk.

  3. In the config file (Timerjobs.config), fill in the Targets:

    Same Site = For all sites on the root level:

    XML
    <Target enabled="true" type="SameLevel">https://contoso.sharepointserver.com/sites/ucc</Target>

    Site Collection = For all sites in this site collection:

    XML
    <Target enabled="true" type="SiteCollection">https://contoso.sharepointserver.com/sites/ucc</Target>

    Site = Only for this site:

    XML
    <Target enabled="true" type="Site">https://contoso.sharepointserver.com/sites/ucc</Target>
  4. Next step is to configure user authentication.

    1. (SharePoint On-premises) Fill in the Username and Encrypted Password.

      Note

      Use the Password Tool in the install directory to encrypt the password.

      XML
      <Username></Username>
      <Password></Password>
  5. Create a Windows Scheduled Task that runs indefinitely every 5 minutes (starting from rounded minutes e.g. 12.00, 12.05, 12.10, 12.15) and starts the executable (WSP.A365.SharePoint.WebJob.TimerJobs.exe).]

    Or use the example XML below to import it into Task Scheduler:

    XML
    <?xml version="1.0" encoding="UTF-16"?>
    <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
    <RegistrationInfo>
    <Date>2019-04-16T15:24:40.1269215</Date>
    <Author>AnywhereNow</Author>
    </RegistrationInfo>
    <Triggers>
    <TimeTrigger>
    <Repetition>
    <Interval>PT5M</Interval>
    <StopAtDurationEnd>false</StopAtDurationEnd>
    </Repetition>
    <StartBoundary>2019-04-16T15:20:00</StartBoundary>
    <Enabled>true</Enabled>
    </TimeTrigger>
    </Triggers>
    <Principals>
    <Principal id="Author">
    <UserId>S-1-5-21-3347327956-105208351-3318644539-10774</UserId>
    <LogonType>Password</LogonType>
    <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
    </Principals>
    <Settings>
    <MultipleInstancesPolicy>Parallel</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
    <StopOnIdleEnd>true</StopOnIdleEnd>
    <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
    <Priority>7</Priority>
    </Settings>
    <Actions Context="Author">
    <Exec>
    <Command>"C:\Program Files\Anywhere365\Scripts\SP_Timerjobs\Wsp.A365.SharePoint.WebJob.TimerJobs.exe"</Command>
    </Exec>
    </Actions>
    </Task>
  6. Make sure that the account that performs the task has sufficient permissions to run the job, even if it is not logged in. Run with highest privileges.