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 UCC A Unified Contact Center, or UCC, is a queue of interactions (voice, email, IM, etc.) that are handled by Agents. Each UCC has its own settings, IVR menus and Agents. Agents can belong to one or several UCCs and can have multiple skills (competencies). A UCC can be visualized as a contact center “micro service”. Customers can utilize one UCC (e.g. a global helpdesk), a few UCC’s (e.g. for each department or regional office) or hundreds of UCC’s (e.g. for each bed at a hospital). They are interconnected and can all be managed from one central location., 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 throttling Throttling, in the context of a software cloud delivery service, is the practice of temporarily suspending or diminishing access to a service offering to a cloud customer. Because cloud platforms are mostly multi-tenant, shared platforms and the usage at any moment of many customers is unpredictable, throttling is a normal and logical procedure of retaining a cloud service for all customers, sometimes at the expense of one or a handful of customers who are at that time using too many resources for the backend platform. Not only a customer itself, but also a "noisy neighbour" on the same platform can be the cause of throttling. Usually service will be resumed at a normal level after a short cool-down period, but can even take up to 24 hours or more. In Microsoft 365 throttling is usually indicated by "429 errors" or "server too busy" messages in logfiles or replies. 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.
-
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.
-
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.
-
In the config file (Timerjobs.config), fill in the Targets:
Same Site = For all sites on the root level:
CopyXML<Target enabled="true" type="SameLevel">https://contoso.sharepointserver.com/sites/ucc</Target>
Site Collection = For all sites in this site collection:
CopyXML<Target enabled="true" type="SiteCollection">https://contoso.sharepointserver.com/sites/ucc</Target>
Site = Only for this site:
-
Next step is to configure user authentication.
-
(SharePoint On-premises) Fill in the Username and Encrypted Password.
Note
Use the Password Tool in the install directory to encrypt the password.
-
-
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:
CopyXML<?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>Workstreampeople B.V.</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> -
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.