forked from okieselbach/Intune
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDetect-ActiveESP.ps1
More file actions
31 lines (25 loc) · 872 Bytes
/
Detect-ActiveESP.ps1
File metadata and controls
31 lines (25 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<#
Version: 1.1
Author: Oliver Kieselbach
Script: Detect-ActiveESP.ps1
Date: 10/20/2022
Description:
Check if Enrollment Status Page (ESP) is still active or not.
Release notes:
Version 1.0: Original published version.
Version 1.1: Changed to check Security Systray Icon
The script is provided "AS IS" with no warranties.
#>
# Make sure Hide Systray ist NOT set to 1 !!
# HKLM\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Systray\HideSystray = 1
# get the "Windows Security notification icon" process, as this process is first started when
# the explorer.exe processes the startup of the logged on user.
$proc = Get-Process -Name SecurityHealthSystray -ErrorAction SilentlyContinue
# Process not found, so ESP is not running
if ($null -ne $proc) {
Write-Output "ESP-not-active"
exit 0
} else {
Write-Output "ESP-active"
exit 0
}