Forum Discussion
Configuration item and Confguration baseline .. in InTune
- Jan 17, 2022
- Publish the app to all machines
- Use a detection script in the with something like this:if ((Get-ItemProperty -Path HKLM:\SOFTWARE\Company\App).Version -eq '1.2') { if (test-path -Path 'C:\Program Files\Company\App\app.exe') { write-host Company App key found with version 1.2 and software is installed exit 0 } else { write-host Company app key found with version 1.2 but software is not installed exit 1 } } if (-not (Get-ItemProperty -Path HKLM:\SOFTWARE\Company\App).Version -eq '1.2') { write-host Company App key not found so no need to install software exit 0 }
So.. If the specific key exists, the one that you want to detect if installation of the software is needed, then it will check for the software by checking the path in c:\program files. If it's not there, it will report it and exit with exit code 1. That way it will know it will have to install the software.
If the specific key doesn't exist on the system, it will exit with exit code 0 telling Intune that the software is installed (Not needed actually, but you know what I mean 😉 )
And like Rudy Ooms said, if the specific key is not there.. You can also create it, I read it like you already had that key present to specify a certain type of machine
- StickybitJan 17, 2022Copper ContributorA different approach is probably needed. 🙂
The problem: I got an application (Windows App Win32), that is assigned to a group of users - with required installation. This application needs to be skipped, if specific registry keys exists on the device.
I guess that I need to add a dynamic group as excluded assignment - and somehow automatically populate this group with users that has the registry keys (this is where I would have used a configuration item / baseline item with SCCM).- Jan 17, 2022Maybe a stupid thought. but why not creating a detection rule and specify that registry key? when the key already exists ... it thinks it is installed... otherwise it will try to install it.. ANd of the app doesn't create the key, create a powershell script that launches the installation and if its done it create that registry key?
- Jan 17, 2022
- Publish the app to all machines
- Use a detection script in the with something like this:if ((Get-ItemProperty -Path HKLM:\SOFTWARE\Company\App).Version -eq '1.2') { if (test-path -Path 'C:\Program Files\Company\App\app.exe') { write-host Company App key found with version 1.2 and software is installed exit 0 } else { write-host Company app key found with version 1.2 but software is not installed exit 1 } } if (-not (Get-ItemProperty -Path HKLM:\SOFTWARE\Company\App).Version -eq '1.2') { write-host Company App key not found so no need to install software exit 0 }
So.. If the specific key exists, the one that you want to detect if installation of the software is needed, then it will check for the software by checking the path in c:\program files. If it's not there, it will report it and exit with exit code 1. That way it will know it will have to install the software.
If the specific key doesn't exist on the system, it will exit with exit code 0 telling Intune that the software is installed (Not needed actually, but you know what I mean 😉 )
And like Rudy Ooms said, if the specific key is not there.. You can also create it, I read it like you already had that key present to specify a certain type of machine
- Jan 17, 2022:).... i guess we have both the same idea 🙂