1515 v1.4 5/15/2024 Rework and simplify. Write out logfile
1616 v1.5 6/21/2024 Adding trmm agent to Check-Memorysize
1717 v1.6 8/26/2024 checking mesh for CF proxy
18+ v1.7 1/8/2026 adding defender exclusion list and program files lists to output
1819#>
1920
2021param (
@@ -350,6 +351,74 @@ function Test-ServerConnections {
350351 }
351352}
352353
354+ function Get-DefenderExclusions {
355+ try {
356+ $preferences = Get-MpPreference - ErrorAction Stop
357+
358+ Write-Output " Path Exclusions:"
359+ if ($preferences.ExclusionPath.Count -gt 0 ) {
360+ foreach ($path in $preferences.ExclusionPath ) {
361+ Write-Output " - $path "
362+ }
363+ }
364+ else {
365+ Write-Output " None"
366+ }
367+
368+ Write-Output " "
369+ Write-Output " Process Exclusions:"
370+ if ($preferences.ExclusionProcess.Count -gt 0 ) {
371+ foreach ($process in $preferences.ExclusionProcess ) {
372+ Write-Output " - $process "
373+ }
374+ }
375+ else {
376+ Write-Output " None"
377+ }
378+
379+ Write-Output " "
380+ Write-Output " Extension Exclusions:"
381+ if ($preferences.ExclusionExtension.Count -gt 0 ) {
382+ foreach ($ext in $preferences.ExclusionExtension ) {
383+ Write-Output " - $ext "
384+ }
385+ }
386+ else {
387+ Write-Output " None"
388+ }
389+ }
390+ catch {
391+ Write-Output " Unable to retrieve Windows Defender exclusions. Error: $_ "
392+ }
393+ }
394+
395+ function Get-ProgramFilesList {
396+ $programFolders = @ (
397+ " C:\Program Files" ,
398+ " C:\Program Files (x86)"
399+ )
400+
401+ foreach ($folder in $programFolders ) {
402+ if (Test-Path $folder ) {
403+ Write-Output " Contents of ${folder} :"
404+ try {
405+ $items = Get-ChildItem - Path $folder - ErrorAction Stop | Select-Object Name, LastWriteTime
406+ foreach ($item in $items ) {
407+ Write-Output " $ ( $item.LastWriteTime.ToString (' yyyy-MM-dd' )) - $ ( $item.Name ) "
408+ }
409+ }
410+ catch {
411+ Write-Output " Unable to list contents. Error: $_ "
412+ }
413+ Write-Output " "
414+ }
415+ else {
416+ Write-Output " ${folder} does not exist."
417+ Write-Output " "
418+ }
419+ }
420+ }
421+
353422function Check-ServicesAndFiles {
354423 param (
355424 [string ]$MeshAgentPath = " C:\Program Files\Mesh Agent\MeshAgent.exe" ,
@@ -454,5 +523,13 @@ Write-Output ""
454523
455524Write-Output " ********************* Mesh Memory Size ************************"
456525Check- MemorySize
526+ Write-Output " "
527+
528+ Write-Output " ************** Windows Defender Exclusions ********************"
529+ Get-DefenderExclusions
530+ Write-Output " "
531+
532+ Write-Output " ******************** Program Files List ***********************"
533+ Get-ProgramFilesList
457534
458535Stop-Transcript
0 commit comments