Use Microsoft Defender's Live Response to run scripts on endpoints. Select a script that exists in storage or upload a new one.
Microsoft Defender
Conor Dunne
How it works
Import this story to your tenant, from where you can adapt it to meet your unique needs.