Legacy
...
Passwork 5
Mapping LDAP security groups w...

Configuring Windows Server Scheduler

9min

💡 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:

Shell


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:

Shell


For Passwork 5:

Shell


The script will display information on the screen and write it to its log file:

Shell


💡 Make sure that the user you are running the script from has write permissions to the logs folder

Configuring Windows Task Scheduler

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:

Document image


The scheduler window will appear:

Document image


On the panel on the right, select the "Create task" command. The task creation window will appear. Enter a name and description:

Document image


After that, choose how often you want to start the process by creating a new trigger on the "Triggers" tab:

Document image


Set the task to be performed daily every 15 minutes:

Document image

Document image


Create a new action on the Actions tab:

Document image


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:

Document image

Document image


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:

Document image


💡 We recommend deleting the log file before starting the scheduler for the first time.

Windows Task Scheduler Logs

You can view the scheduler log in the Event Viewer in Windows by the path "Application and Services logs → Microsoft → Windows → TaskScheduler → Operational"

Document image