PowerShell Script to restart the SEP Client service
search cancel

PowerShell Script to restart the SEP Client service

book

Article ID: 389125

calendar_today

Updated On: 02-25-2025

Products

Endpoint Security Complete

Issue/Introduction

A PowerShell script is needed to restart the SEP Client Service. This may be due to various reasons:

  • Client is stuck, not getting updates
  • Memory issues
  • Stale cache for definitions etc.

Resolution

These scrips are provided "As is" and do not imply any warrantees or guarantees.

NOTE: Tamper Protection needs to be disabled in order for these scripts to work.

Here is a script that will prompt for a computer name and will connect to the system and attempt to restart the SEP service:

$computer = Read-Host -Prompt "Enter Target Computer Name"
if ([string]::IsNullOrEmpty($computer.Trim())) {
    Write-Host "Machine name not specified`nTerminating Script"
    exit
}

try {
    $wmiService = Get-WmiObject -ComputerName $computer -Namespace "root\cimv2" -Class "Win32_Process"
    $wmiService.Create("C:\Program Files\Symantec\Symantec Endpoint Protection\smc.exe -stop")
    Start-Sleep -Seconds 10
    $wmiService.Create("C:\Program Files\Symantec\Symantec Endpoint Protection\smc.exe -start")
} catch {
    Write-Host "Error occurred: $_"
}

This script simply runs on the computer it is set to

try {
    $wmiService = Get-WmiObject -Namespace "root\cimv2" -Class "Win32_Process"
    $wmiService.Create("C:\Program Files\Symantec\Symantec Endpoint Protection\smc.exe -stop")
    Start-Sleep -Seconds 10
    $wmiService.Create("C:\Program Files\Symantec\Symantec Endpoint Protection\smc.exe -start")
} catch {
    Write-Host "Error occurred: $_"
}