Jump to content


jblackburn

New Members
  • Posts

    2
  • Joined

  • Last visited

jblackburn's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Yes I can run manually. I am opening powershell with admin rights, setting the executionpolicy to bypass then running the script. It works If I get the sccm client to run the script I get the error. I was looking at permissions but I can't figure out a pattern.
  2. I'm getting an error back on around 20% of clients failing to run scripts. When my script runs that is part of an advert I get an error in execmgr.log listing error "Invalid executable file powershell" The exact same script is working on 80% of machines!! I am currently on Windows 10 generally build 1703 but the issue happens on build 1709 as well. If I rebuild the machine I get no issues the scripts run on the same machine. I'm trying to figure out the cause so I don't need to reimage the whole machine just because it won't run a powershell script. My sccm is on the latest 1803 and the clients are updating correctly showing the latest version I am using the following command to execute the script powershell -executionPolicy unrestricted -noexit -file ".\filename" Execmgr give the following as an example. Executing program powershell -executionPolicy unrestricted -noexit -file ".\DeleteWindowsOld.ps1" in --Admin context execmgr 18/04/2018 16:08:55 8240 (0x2030) Execution Request for advert HWA20032 package HWA00059 program CleanMgr state change from --Ready to NotifyExecution execmgr 18/04/2018 16:08:55 8240 (0x2030) 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 18/04/2018 16:08:55 8240 (0x2030) Checking content location C:\Windows\ccmcache\5 for use execmgr 18/04/2018 16:08:55 8240 (0x2030) Successfully selected content location C:\Windows\ccmcache\5 execmgr 18/04/2018 16:08:55 8240 (0x2030) Executing program as a script execmgr 18/04/2018 16:08:55 8240 (0x2030) Invalid executable file powershell execmgr 18/04/2018 16:08:55 8240 (0x2030) Raising event: [SMS_CodePage(437), SMS_LocaleID(1033)] instance of SoftDistProgramBadEnvironmentEvent { AdvertisementId = "HWA20032"; ClientID = "GUID:ADC31248-103F-4445-B66C-6E7F874719AB"; CommandLine = "powershell -executionPolicy unrestricted -noexit -file \".\\DeleteWindowsOld.ps1\""; DateTime = "20180418150855.412000+000"; DriveLetter = ""; MachineName = "TL-1004"; PackageName = "HWA00059"; ProcessID = 5776; ProgramName = "CleanMgr"; SiteCode = "HWA"; ThreadID = 8240; Win32ErrorCode = 2147942402; WorkingDirectory = ""; }; execmgr 18/04/2018 16:08:55 8240 (0x2030) Raised Program Bad Environment Event for Ad:HWA20032, Package:HWA00059, Program: CleanMgr execmgr 18/04/2018 16:08:55 8240 (0x2030) EnterRsRuningState failed to run script powershell -executionPolicy unrestricted -noexit -file ".\DeleteWindowsOld.ps1" 0x87d01106 execmgr 18/04/2018 16:08:55 8240 (0x2030) Fatal error 0x87d01106 enountered for program CleanMgr. This program will not retry. execmgr 18/04/2018 16:08:55 8240 (0x2030) Requesting MTC to delete task with id: {7A861C8B-7075-426A-A3C8-8781FE53AEBA} execmgr 18/04/2018 16:08:55 8240 (0x2030)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.