From c482e0bbc2ae6797c551844c111dde259203caa1 Mon Sep 17 00:00:00 2001 From: dyoder Date: Thu, 29 Jul 2021 13:28:43 -0400 Subject: [PATCH] added several services to delete --- Uninstall-NCentralComponents.ps1 | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Uninstall-NCentralComponents.ps1 b/Uninstall-NCentralComponents.ps1 index d89df20..a1b2df4 100644 --- a/Uninstall-NCentralComponents.ps1 +++ b/Uninstall-NCentralComponents.ps1 @@ -38,6 +38,36 @@ If ( $Service.Length -gt 0 ) { Catch { LogErr $_.Exception.Message } } +## Remove Windows Software Probe Maintenance Service +$ServiceName = "Windows Software Probe Maintenance Service" +$Service = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue +If ( $Service.Length -gt 0 ) { + Control-Service -Stop -Name $ServiceName + LogMsg "Deleting the service: ""${ServiceName}""" + Try { Start-Process "sc" -ArgumentList "delete ${ServiceName}" -Wait } + Catch { LogErr $_.Exception.Message } +} + +## Remove Windows Software Probe Syslog Service +$ServiceName = "Windows Software Probe Syslog Service" +$Service = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue +If ( $Service.Length -gt 0 ) { + Control-Service -Stop -Name $ServiceName + LogMsg "Deleting the service: ""${ServiceName}""" + Try { Start-Process "sc" -ArgumentList "delete ${ServiceName}" -Wait } + Catch { LogErr $_.Exception.Message } +} + +## Remove Windows Software Probe Service +$ServiceName = "Windows Software Probe Service" +$Service = Get-Service -Name $ServiceName -ErrorAction SilentlyContinue +If ( $Service.Length -gt 0 ) { + Control-Service -Stop -Name $ServiceName + LogMsg "Deleting the service: ""${ServiceName}""" + Try { Start-Process "sc" -ArgumentList "delete ${ServiceName}" -Wait } + Catch { LogErr $_.Exception.Message } +} + ## Remove "MspPlatform" directory If ( Test-Path "${Env:ProgramFiles(x86)}\MspPlatform" ) { LogMsg "Forcefully removing ""${Env:ProgramFiles(x86)}\MspPlatform"""