Configuring Windows Server Scheduler
💡 This is obsolete documentation for older versions of Passwork (before 5.1.0).
Starting from version 5.1.0 Passwork uses built-in background task mechanisms for LDAP synchronization.
Windows Task Scheduler is a component of the Windows operating system. It is used to run certain scripts on the server at the right time, on a schedule.
Passwork has a special script that synchronizes users in LDAP groups:
It can be run manually or configured to run on a schedule using Windows Task Scheduler.
We recommend that you first check how the script works in the manual mode. To do this, run the following script at the Windows command prompt:
For Passwork 4:
For Passwork 5:
The script will display information on the screen and write it to its log file:
💡 Make sure that the user you are running the script from has write permissions to the logs folder
In this example, we will show you how to configure the Windows Task Scheduler to execute a script every 15 minutes. You can set up a different frequency.
Open the task scheduler by pressing the Win + R keyboard shortcut and enter taskschd.msc:
The scheduler window will appear:
On the panel on the right, select the "Create task" command. The task creation window will appear. Enter a name and description:
After that, choose how often you want to start the process by creating a new trigger on the "Triggers" tab:
Set the task to be performed daily every 15 minutes:
Create a new action on the Actions tab:
Specify the path to the php.exe executable file used on your system. Specify the file path C:\inetpub\wwwroot\app\tools\ldap-mapping.php as an argument:
Click "Ok". The scheduler will launch the script in 15 minutes, the result of its work can be seen in the log file. You can also select the created task and start it immediately:
💡 We recommend deleting the log file before starting the scheduler for the first time.
You can view the scheduler log in the Event Viewer in Windows by the path "Application and Services logs → Microsoft → Windows → TaskScheduler → Operational"