Forum Discussion
AB21805
Jan 12, 2023Bronze Contributor
How do I restart a service - via intune
Hi all, The service wildsvc has stopped on some machines and I need it to be running so that I can make sure my update features are getting deployed to the devices. Is there a way through in...
RGijsbersRademakers
Jan 12, 2023Iron Contributor
Hi A, Depending on your license, you could make use of proactive remediations. You can create a detection script which will check if the service is running. If that's not the case, the remediation script will kick in which starts the service. More info can be found here: https://learn.microsoft.com/en-us/mem/analytics/proactive-remediations If you don't have the required licences, you could create a custom powershell script which deploys a scheduled task that regularly checks the service and starts the service if it's stopped. Regards, Ruud
- AB21805Jan 12, 2023Bronze ContributorHi, I do have the license, what would the scripts look like?
Thanks in advanced- RGijsbersRademakersJan 12, 2023Iron ContributorA few examples can be found here: https://learn.microsoft.com/en-us/mem/analytics/powershell-scripts
In the try sections, you would put something like
$result = Get-Service wildsvc
If ( $result.status -eq stopped){
Write-Host "Match"
Exit 1}
Else {
Exit 0 }
The remediation script would then contain a Start-Service wildsvc
Regards,
Ruud- AB21805Jan 12, 2023Bronze ContributorHi Ruud,
So would the remediation script look like this:
$result = Start-Service wildsvc
If ( $result.status -eq stopped){
Write-Host "Match"
Exit 1}
Else {
Exit 0 }
- Jan 12, 2023You could always ask chatgpt to write you a script to restart a service when it was stopped ? 🙂 but there is even a build in one.... to restart the office c2r service
https://www.anoopcnair.com/deploy-proactive-remediation-script-intune/- AB21805Jan 12, 2023Bronze ContributorHi Rudy,
I need to restart the wlidsvc service or does Office c2r service also include the wlidsvc service?