Wednesday, April 16, 2014

ReDeploy Custom Timer Job using PowerShell

Following are the steps you need to redeploy a custom timer job.

Disable-SPFeature -Identity "91b81920-cc93-46da-b2c9-7e29c5077a67" -Url "http://sp2013.com/"
UnInstall-SPFeature -Identity "91b81920-cc93-46da-b2c9-7e29c5077a67"

Uninstall-SPSolution -Identity TimerJob.wsp –allwebapplications
Remove-SPSolution TimerJob.wsp –force

Add-spsolution C:\temp\TimerJob.wsp
Install-spsolution TimerJob.wsp -GACDeployment –force

Enable-SPFeature -Identity "91b81920-cc93-46da-b2c9-7e29c5077a67" -Url "http://sp2013.com/" –PassThru

Stop-Service SPTimerV4
Start-Service SPTimerV4

If you use update solution TimerJob may not pickup updated functionality
//Update-SPSolution -Identity timerjob.wsp -LiteralPath C:\temp\TimerJob.wsp -GACDeployment

No comments:

Post a Comment