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


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.




2 Replies

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 ....



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.