The easiest and safest way is to create Maintenance Plan.
Expand Management in Object Explorer> Right-click Maintenance Plans> Maintenance Wizard> Create Index Recovery Plan.
Must be straight. As a result, it executes the task in your server agent, and then you can set the schedule or run the task manually by running this script
EXEC msdb..sp_start_job N'NAME OF JOB'
Service Plan Wizard
, . /, , . , . , Management Studio . .
, ,
>