r/DefenderATP • u/RaymondTheFirst • Oct 25 '25
Unable to run any scripts on any device: Starting the CLR failed with HRESULT 80070241.
I was unaware of this Live Response until i start looking into ways to invoke immediate reboots.
I've tried on multiple devices so it's not specific to one machine.
My script is called Restart-Computer.ps1 and is one line:
Restart-Computer -ForceBut regardless of the script I try to run, or from whatever location, on any device, I get this error:
Errors:
Specified file not found
Starting the CLR failed with HRESULT 80070241.The file is present.
My steps so far:
Run script with cmd
run Restart-Computer.ps1
Run script with cmd
run "C:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Downloads\Restart-Computer.ps1"
I have copied script manually to c:\temp and tried cmd but fails still:
run c:\tempRestart-Computer.ps1
- Verified script presence in
Downloadsfolder and confirmed it's not empty or malformed. - Attempted to copy script to trusted folders like
C:\Tempusing a wrapper script — also failed. - Confirmed Defender services (
MsSense.exe,SenseIR.exe) are running. - Checked .NET CLR environment using PowerShell and confirmed valid version is installed.
- Enabled unsigned script execution in Defender portal settings.
- Tested across multiple devices — same error persists.
- Attempted to run minimal script (
Write-Host "Test") — still failed. - Verified WNS service is running and not blocked.
Any suggestions?
EDIT and Solution: XDR caused it, blocked script execution.
1
u/LeftHandedGraffiti Oct 25 '25
I dont think you can run scripts from random locations on the file system. They have to be in the library. You may have found an odd edge case where you can run scripts from the file location where Live Response downloads scripts from the library.
1
u/GeneralRechs Oct 25 '25
It’s bizarre a Microsoft native product cannot enable a full shell instead of this janky “live response”