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
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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 )
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’);
}
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%