Restart CCMExec only once on 2000 machine with GPO

Question

Hi Experts ,

I want to restart CCMExec service only once on 2000 machine with GPO.

What will be the best way to achieve this ?

Thanks,
Ketan KAmble

Answers ( 2 )

    0
    2021-06-01T10:54:57+05:30

    Hi Ketan,

    as per my understood GPO can’t execute to all machines at the same time.

    It better to use PowerShell script execution remotely by using the below script, or else you can use SCCM Script deployment.

    $computers = Get-Content C:\computers.txt
    ForEach ($computer in $computers)
    {
    Restart-Service -InputObject $(Get-Service -Computer $computer -Name ‘SMS Agent Host’);
    }

      0
      2021-06-11T23:05:46+05:30

      I am thinking of doing it via Endpoint analytics and their Proactive remediation’s …
      Thinking of doing something like this with powershell.

      @echo off
      If exist “C:\Temp\CCMExec_restart.txt” GOTO END
      net stop CCMEXEC
      timeout 100
      net start CCMEXEC
      timeout 120
      WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule “{00000000-0000-0000-0000-000000000001}” /NOINTERACTIVE
      timeout 50
      WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule “{00000000-0000-0000-0000-000000000021}” /NOINTERACTIVE
      date /T >”C:\Temp\CCMExec_restart.txt”
      time /T >>”C:\Temp\CCMExec_restart.txt”
      :END
      EXIT /B %errorcode%

      Best answer

Leave an answer

Sorry, you do not have permission to answer to this question .