run script from specific location on windows 10 machines

%3CLINGO-SUB%20id%3D%22lingo-sub-2575566%22%20slang%3D%22en-US%22%3Erun%20script%20from%20specific%20location%20on%20windows%2010%20machines%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2575566%22%20slang%3D%22en-US%22%3E%3CP%3EHi.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20to%20block%26nbsp%3B%20scripts%20from%20running%20on%20user%20machines%2C%20except%20from%201%20specific%20location.%26nbsp%3B%20Since%20this%20will%20impact%20policy%20scripts%20from%20running%20from%20Intune%2C%20I'm%20looking%20for%20help%20with%20how%20to%20create%20a%20policy%20in%20Intune%20that%20would%20then%20copy%20the%20.ps1%20to%20this%20approved%20directory%20on%20the%20end%20user%20machine%20and%20run%20from%20there.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETIA%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2575566%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EIntune%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2576053%22%20slang%3D%22en-US%22%3ERe%3A%20run%20script%20from%20specific%20location%20on%20windows%2010%20machines%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2576053%22%20slang%3D%22en-US%22%3EPut%20the%20script%20on%20a%20blob%20storage%20and%20create%20an%20Endpoint%20Analytics%20script%20that%20downloads%20and%20executes%20the%20script.%3C%2FLINGO-BODY%3E
New Contributor

Hi.

 

I need to block  scripts from running on user machines, except from 1 specific location.  Since this will impact policy scripts from running from Intune, I'm looking for help with how to create a policy in Intune that would then copy the .ps1 to this approved directory on the end user machine and run from there.

 

TIA

 

 

1 Reply
Hi

Are you already using applocker? maybe adding some exclusions. So all other locations are blocked except the location where user based powershell scripts are launched from?