jblackburn
Member
- Messages
- 15
- Reaction score
- 1
- Points
- 3
I get this error when I'm trying to run powershell scripts on maybe 30% of my machines (1703 and 1709). I get a similar error for none powershell scripts but I might come back to that one in a separate thread as to not confuse the thread. So far machines I have upgraded to 1803 all show the same error I just need to test on newly imaged machines.
My scripts works. I can manually run the script, it works. I have the script on the TS sequence now for all new machines and it works. I have added the scripts into the scripts section which also now fail to run. The three main ones I'm trying to run are to set a lock screen, set a desktop and run diskclean to remove windows.old and old windows updates. The lockscreen and windows cleanup are powershell
example of the execmgr
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="HWA0005D",ProgramID="Deploy_LockScreen", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 11/05/2018 09:47:12 3268 (0x0CC4)
Mandatory execution requested for program CleanMgr and advertisement HWA20032 execmgr 11/05/2018 09:48:04 5056 (0x13C0)
Creating mandatory request for advert HWA20032, program CleanMgr, package HWA00059 execmgr 11/05/2018 09:48:04 5056 (0x13C0)
Policy is updated for Program: CleanMgr, Package: HWA00059, Advert: HWA20032 execmgr 11/05/2018 09:48:04 3684 (0x0E64)
Requesting content from CAS for package HWA00059 version 8 execmgr 11/05/2018 09:48:04 5056 (0x13C0)
Successfully created a content request handle {27713A60-2391-426F-BE70-8230AA415189} for the package HWA00059 version 8 execmgr 11/05/2018 09:48:04 5056 (0x13C0)
An existing MTC token was not supplied, using ExecutionRequest's Id as MTC token and this execution request is the owner of resultant MTC task. execmgr 11/05/2018 09:48:04 5056 (0x13C0)
Request a MTC task for execution request of package HWA00059, program CleanMgr with request id: {4DEC36D4-9047-4E08-B8B2-C5F716422AB3} execmgr 11/05/2018 09:48:04 5056 (0x13C0)
Execution Request for advert HWA20032 package HWA00059 program CleanMgr state change from NotExist to Ready execmgr 11/05/2018 09:48:04 5056 (0x13C0)
MTC task with id {4DEC36D4-9047-4E08-B8B2-C5F716422AB3}, changed state from 0 to 4 execmgr 11/05/2018 09:48:04 5624 (0x15F8)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="HWA00059",ProgramID="CleanMgr", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 11/05/2018 09:48:05 5056 (0x13C0)
Sending ack to MTC for task with id: {4DEC36D4-9047-4E08-B8B2-C5F716422AB3} execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Executing program powershell -executionPolicy unrestricted -noexit -file ".\DeleteWindowsOld.ps1" in Admin context execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Execution Request for advert HWA20032 package HWA00059 program CleanMgr state change from Ready to NotifyExecution execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="HWA00059",ProgramID="CleanMgr", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Checking content location C:\Windows\ccmcache\l for use execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Successfully selected content location C:\Windows\ccmcache\l execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Executing program as a script execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Invalid executable file powershell execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Raising event:
[SMS_CodePage(437), SMS_LocaleID(1033)]
instance of SoftDistProgramBadEnvironmentEvent
{
AdvertisementId = "HWA20032";
ClientID = "GUID:0373851E-B292-41E7-A7F1-85E0469870BD";
CommandLine = "powershell -executionPolicy unrestricted -noexit -file \".\\DeleteWindowsOld.ps1\"";
DateTime = "20180511084805.538000+000";
DriveLetter = "";
MachineName = "TL-1384";
PackageName = "HWA00059";
ProcessID = 1036;
ProgramName = "CleanMgr";
SiteCode = "HWA";
ThreadID = 3684;
Win32ErrorCode = 2147942402;
WorkingDirectory = "";
};
execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Raised Program Bad Environment Event for Ad:HWA20032, Package:HWA00059, Program: CleanMgr execmgr 11/05/2018 09:48:05 3684 (0x0E64)
EnterRsRuningState failed to run script powershell -executionPolicy unrestricted -noexit -file ".\DeleteWindowsOld.ps1" 0x87d01106 execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Fatal error 0x87d01106 enountered for program CleanMgr. This program will not retry. execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Requesting MTC to delete task with id: {4DEC36D4-9047-4E08-B8B2-C5F716422AB3} execmgr 11/05/2018 09:48:05 3684 (0x0E64)
MTC task with id: {4DEC36D4-9047-4E08-B8B2-C5F716422AB3} deleted successfully. execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="HWA00059",ProgramID="CleanMgr", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Requesting MTC to delete task with id: {4DEC36D4-9047-4E08-B8B2-C5F716422AB3} execmgr 11/05/2018 09:48:05 3684 (0x0E64)
This execution request does not have a corresponding task in MTC. execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="HWA00059",ProgramID="CleanMgr", actionType 45l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Execution Request not found for the supplied MTC Task id: {4DEC36D4-9047-4E08-B8B2-C5F716422AB3} execmgr 11/05/2018 09:48:05 5624 (0x15F8)
MTC task with id {4DEC36D4-9047-4E08-B8B2-C5F716422AB3}, changed state from 4 to 5 execmgr 11/05/2018 09:48:05 3684 (0x0E64)
The powershell script for this is attached as a txt
My scripts works. I can manually run the script, it works. I have the script on the TS sequence now for all new machines and it works. I have added the scripts into the scripts section which also now fail to run. The three main ones I'm trying to run are to set a lock screen, set a desktop and run diskclean to remove windows.old and old windows updates. The lockscreen and windows cleanup are powershell
example of the execmgr
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="HWA0005D",ProgramID="Deploy_LockScreen", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 11/05/2018 09:47:12 3268 (0x0CC4)
Mandatory execution requested for program CleanMgr and advertisement HWA20032 execmgr 11/05/2018 09:48:04 5056 (0x13C0)
Creating mandatory request for advert HWA20032, program CleanMgr, package HWA00059 execmgr 11/05/2018 09:48:04 5056 (0x13C0)
Policy is updated for Program: CleanMgr, Package: HWA00059, Advert: HWA20032 execmgr 11/05/2018 09:48:04 3684 (0x0E64)
Requesting content from CAS for package HWA00059 version 8 execmgr 11/05/2018 09:48:04 5056 (0x13C0)
Successfully created a content request handle {27713A60-2391-426F-BE70-8230AA415189} for the package HWA00059 version 8 execmgr 11/05/2018 09:48:04 5056 (0x13C0)
An existing MTC token was not supplied, using ExecutionRequest's Id as MTC token and this execution request is the owner of resultant MTC task. execmgr 11/05/2018 09:48:04 5056 (0x13C0)
Request a MTC task for execution request of package HWA00059, program CleanMgr with request id: {4DEC36D4-9047-4E08-B8B2-C5F716422AB3} execmgr 11/05/2018 09:48:04 5056 (0x13C0)
Execution Request for advert HWA20032 package HWA00059 program CleanMgr state change from NotExist to Ready execmgr 11/05/2018 09:48:04 5056 (0x13C0)
MTC task with id {4DEC36D4-9047-4E08-B8B2-C5F716422AB3}, changed state from 0 to 4 execmgr 11/05/2018 09:48:04 5624 (0x15F8)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="HWA00059",ProgramID="CleanMgr", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 11/05/2018 09:48:05 5056 (0x13C0)
Sending ack to MTC for task with id: {4DEC36D4-9047-4E08-B8B2-C5F716422AB3} execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Executing program powershell -executionPolicy unrestricted -noexit -file ".\DeleteWindowsOld.ps1" in Admin context execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Execution Request for advert HWA20032 package HWA00059 program CleanMgr state change from Ready to NotifyExecution execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="HWA00059",ProgramID="CleanMgr", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Checking content location C:\Windows\ccmcache\l for use execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Successfully selected content location C:\Windows\ccmcache\l execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Executing program as a script execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Invalid executable file powershell execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Raising event:
[SMS_CodePage(437), SMS_LocaleID(1033)]
instance of SoftDistProgramBadEnvironmentEvent
{
AdvertisementId = "HWA20032";
ClientID = "GUID:0373851E-B292-41E7-A7F1-85E0469870BD";
CommandLine = "powershell -executionPolicy unrestricted -noexit -file \".\\DeleteWindowsOld.ps1\"";
DateTime = "20180511084805.538000+000";
DriveLetter = "";
MachineName = "TL-1384";
PackageName = "HWA00059";
ProcessID = 1036;
ProgramName = "CleanMgr";
SiteCode = "HWA";
ThreadID = 3684;
Win32ErrorCode = 2147942402;
WorkingDirectory = "";
};
execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Raised Program Bad Environment Event for Ad:HWA20032, Package:HWA00059, Program: CleanMgr execmgr 11/05/2018 09:48:05 3684 (0x0E64)
EnterRsRuningState failed to run script powershell -executionPolicy unrestricted -noexit -file ".\DeleteWindowsOld.ps1" 0x87d01106 execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Fatal error 0x87d01106 enountered for program CleanMgr. This program will not retry. execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Requesting MTC to delete task with id: {4DEC36D4-9047-4E08-B8B2-C5F716422AB3} execmgr 11/05/2018 09:48:05 3684 (0x0E64)
MTC task with id: {4DEC36D4-9047-4E08-B8B2-C5F716422AB3} deleted successfully. execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="HWA00059",ProgramID="CleanMgr", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Requesting MTC to delete task with id: {4DEC36D4-9047-4E08-B8B2-C5F716422AB3} execmgr 11/05/2018 09:48:05 3684 (0x0E64)
This execution request does not have a corresponding task in MTC. execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="HWA00059",ProgramID="CleanMgr", actionType 45l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 11/05/2018 09:48:05 3684 (0x0E64)
Execution Request not found for the supplied MTC Task id: {4DEC36D4-9047-4E08-B8B2-C5F716422AB3} execmgr 11/05/2018 09:48:05 5624 (0x15F8)
MTC task with id {4DEC36D4-9047-4E08-B8B2-C5F716422AB3}, changed state from 4 to 5 execmgr 11/05/2018 09:48:05 3684 (0x0E64)
The powershell script for this is attached as a txt