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

in progress 0
Ketan Kamble 3 weeks 2021-05-31T23:35:58+05:30 2 Answers 9 views Beginner 0

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%

Leave an answer

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