Hello,
I have in the AppEnforce.log for a client :
+++ Starting Install enforcement for App DT "ISS - Servers - Deployment Windows Defender Features" ApplicationDeliveryType - ScopeId_67BB9074-421B-4166-A053-A8090F9523EF/DeploymentType_538c539d-6ef9-43f8-9f5a-747a59fd1b74, Revision - 3, ContentPath - C:\Windows\ccmcache\e, Execution Context - System AppEnforce 8/17/2022 7:47:45 AM 8736 (0x2220)
Performing detection of app deployment type ISS - Servers - Deployment Windows Defender Features(ScopeId_67BB9074-421B-4166-A053-A8090F9523EF/DeploymentType_538c539d-6ef9-43f8-9f5a-747a59fd1b74, revision 3) for system. AppEnforce 8/17/2022 7:47:45 AM 8736 (0x2220)
+++ Application not discovered. [AppDT Id: ScopeId_67BB9074-421B-4166-A053-A8090F9523EF/DeploymentType_538c539d-6ef9-43f8-9f5a-747a59fd1b74, Revision: 3] AppEnforce 8/17/2022 7:47:45 AM 8736 (0x2220)
App enforcement environment:
Context: Machine
Command line: "Windows_Defender_Feature_Restart.cmd"
Allow user interaction: No
UI mode: 1
User token: null
Session Id: 2
Content path: C:\Windows\ccmcache\e
Working directory: AppEnforce 8/17/2022 7:47:45 AM 8736 (0x2220)
Prepared working directory: C:\Windows\ccmcache\e AppEnforce 8/17/2022 7:47:45 AM 8736 (0x2220)
Prepared command line: "C:\Windows\ccmcache\e\Windows_Defender_Feature_Restart.cmd" AppEnforce 8/17/2022 7:47:45 AM 8736 (0x2220)
Executing Command line: "C:\Windows\ccmcache\e\Windows_Defender_Feature_Restart.cmd" with user context AppEnforce 8/17/2022 7:47:45 AM 8736 (0x2220)
Working directory C:\Windows\ccmcache\e AppEnforce 8/17/2022 7:47:45 AM 8736 (0x2220)
Post install behavior is BasedOnExitCode AppEnforce 8/17/2022 7:47:45 AM 8736 (0x2220)
Waiting for process 8456 to finish. Timeout = 120 minutes. AppEnforce 8/17/2022 7:47:45 AM 8736 (0x2220)
=================================================================
when checking the processID 8456 it is the cmd.exe launching the installation of "Windows_Defender_Feature_Restart.cmd" ... am I in a loop? is the thread 8736 waiting for itself on 8456?
![232065-2022-08-17-8-08-56-vitparata1-cmd.png](https://learn-attachment.microsoft.com/api/attachments/232065-2022-08-17-8-08-56-vitparata1-cmd.png?platform=QnA)
Effectively when killing in task manager the process 8456 it shows that the Windows Defender features are installed...
but the restart did not happened???
![232104-2022-08-17-8-22-09-vitparata1-cmd.png](https://learn-attachment.microsoft.com/api/attachments/232104-2022-08-17-8-22-09-vitparata1-cmd.png?platform=QnA)
==================================================================
@Echo off
pushd "%~dp0"
PowerShell.exe -nologo -noprofile -ExecutionPolicy bypass -file "Installation Windows Defender Feature-Restart.ps1"
==================================================================
and then the "Installation Windows Defender Feature-Restart-ps1 is:
==================================================================
Get-WindowsOptionalFeature -Online -FeatureName "Windows-Defender*" | Format-Table
Enable-WindowsOptionalFeature -Online -FeatureName "Windows-Defender-Features"
Enable-WindowsOptionalFeature -Online -FeatureName "Windows-Defender"
Get-WindowsOptionalFeature -Online -FeatureName "Windows-Defender*" | Format-Table
==================================================================
Thanks,
Dom