Application Script Detection Method - Are Application Files Accessible to the Detection Script?

%3CLINGO-SUB%20id%3D%22lingo-sub-2957385%22%20slang%3D%22en-US%22%3EApplication%20Script%20Detection%20Method%20-%20Are%20Application%20Files%20Accessible%20to%20the%20Detection%20Script%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2957385%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20a%20long%20time%20SCCM%20user%20and%20use%20both%20SCCM%20and%20Intune%20to%20manage%20our%20devices.%20I%20was%20building%20an%20application%20in%20SCCM%20using%20a%20script%20detection%20method%20and%20after%20quite%20a%20bit%20of%20troubleshooting%2C%20I%20realized%20that%20I%20was%20asking%20my%20detection%20method%20to%20reference%20a%20file%20included%20in%20the%20application%20package%20which%20I%20now%20know%20is%20not%20possible.%20For%20example%2C%20a%20file%20from%20nVIDIA%20called%20configureDriver.exe%20can%20be%20used%20to%20both%20%3CEM%3Eshow%3C%2FEM%3E%20and%20%3CEM%3Eset%3C%2FEM%3E%20driver%20configuration.%20My%20application%20package%20includes%20this%20file%20with%20a%20command%20to%20%3CEM%3Eset%3C%2FEM%3E%20the%20config.%20My%20custom%20PowerShell%20script%20detection%20method%20also%20referenced%20this%20file%20to%20parse%20the%20output%20to%20detect%20the%20current%20state.%20This%20was%20failing%20because%20the%20detection%20method%20script%20and%20the%20application%20are%20downloaded%20and%20executed%20in%20different%20temporary%20locations%20so%20it's%20not%20possible%20for%20the%20detection%20method%20to%20reference%20files%20included%20in%20the%20application.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20question%20is...%20does%20Intune%20work%20the%20same%20way%3F%20Is%20the%20detection%20script%20downloaded%20to%20the%20device%20separately%20from%20the%20application%20payload%2Fpackage%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ehope%20this%20makes%20sense.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%2C%3C%2FP%3E%3CP%3EDan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2957385%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EIntune%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

I'm a long time SCCM user and use both SCCM and Intune to manage our devices. I was building an application in SCCM using a script detection method and after quite a bit of troubleshooting, I realized that I was asking my detection method to reference a file included in the application package which I now know is not possible. For example, a file from nVIDIA called configureDriver.exe can be used to both show and set driver configuration. My application package includes this file with a command to set the config. My custom PowerShell script detection method also referenced this file to parse the output to detect the current state. This was failing because the detection method script and the application are downloaded and executed in different temporary locations so it's not possible for the detection method to reference files included in the application.

 

My question is... does Intune work the same way? Is the detection script downloaded to the device separately from the application payload/package?

 

hope this makes sense.

 

thanks,

Dan

2 Replies
Hi,

Maybe just a simple idea, why not creating the intunewinapp and specifying the copy command to copy this file to specific location which you can use in your detection script? Works for me ....

@Rudy_Ooms 

 

Hi Rudy, yeah I've been noodling on that but I think that goes back to the root of my question. That's a chicken/egg problem. The application (with the file and copy job) won't run unless the detection method determines that the app isn't installed but the detection method can't run without the file. I've also been having trouble getting the application install to run when the detection method fails but I think that has more to do with what I'm outputting on the custom detection script. Seems like any kind of unexpected error in the detection script results in an "unknown" detection which does not trigger the application.

 

in any case, I suppose I could create a two step detection method... when the detection runs and the file is missing, it would immediately report that the application is missing which would run the application which would copy the file. The next time it runs, the file would be present, then it would run the detection logic and report success or failure.