Forum Discussion

zac's avatar
zac
Copper Contributor
Jun 17, 2025

Deploying Script as Win32 App

Hi all,

 

I created a script that is supposed to check if a certain app was installed from a managed installer, then create a file in the C:\Temp folder if it was installed from a managed installer. I would deploy this as a Win32 app so that I could use the detection rules in the Win32 App deployment to check which device was installed via a managed installer. However, it doesn't seem to work. I created a transcript log as well to check if I would get an output from the variables, but it seems to only run the else block in the If Statement. We use a Business Premium license, so I don't access to Enterprise license capabilities like proactive remediation scripts. It is run using the System credentials, I've tested the script locally which works. Thank you, I've included some images of the script and transcript log.

 

Script:

 

Transcript Log Output:

 

1 Reply

  • Moritz45's avatar
    Moritz45
    Copper Contributor

    Hello. A quick question to get started:

    • Did you test the script locally using System Credentials as well (through e.g sysinternals) or did you run it as a local administrator?

    One thing that has given me headaches before is that Intune runs these scripts in a 32 bit Powershell by default (thus the name win32). You can switch to 64-bit but you have to do this explicitly by calling a different path for Powershell:

    %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe

    Let me know if testing it through the System account using sysnative or running it as 64 bit powershell changes anything. If the script works when run locally using System and as 64-bit in Intune there is no reason that it should not work when deployed as an Intune App.

    Sidenote: I dont fully understand your setup and why you detect apps through intune but opt to not manage them through Intune as well. Could you shine some light on this matter?

Resources