Powershell and cmd logs ... loop?

Duchemin, Dominique 2,006 Reputation points
2022-08-17T15:11:52.387+00:00

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

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

==================================================================

@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

Microsoft Configuration Manager
{count} votes

1 answer

Sort by: Most helpful
  1. Frank Dong 31 Reputation points
    2022-09-07T01:57:56.653+00:00

    Try to run the script manually (with the same context with running by Configmgr client), you'll see how it will act and know most of the issues.

    If the process is not finished, then it must be waiting for input. I guess it's waiting for the comfirmation for reboot. that's why it's not reboot.
    You can use -NoRestart to suppress the reboot and see if the process finish correctly.

    1 person found this answer helpful.
    0 comments No comments