Add MSI GUID as a detection method in SCCM Application
- garciaoscar615
- May 29
- 2 min read
Pulling the GUID from an MSI and adding it as a detection method for an Application in SCCM is a nice thing to have, as it enhances the management and deployment of applications within the System Center Configuration Manager (SCCM) environment. This process is particularly valuable for ensuring that applications are correctly identified and can be effectively monitored for installation status across various systems in your organization. Understanding how to execute this task can streamline your application deployment processes and improve overall efficiency. So, how would one go about doing this in a structured manner?
First, we need to extract the GUID or Product Code from the MSI file. The GUID, which is a unique identifier for the application, is crucial for SCCM to recognize and manage the application effectively. Since an MSI file is essentially a database, we can utilize specific tools or scripts to pull the GUID directly from the MSI. One common approach is to use the Windows Installer command-line tool, msiexec, or PowerShell scripts that leverage the Windows Installer API. For example, we can create a function in PowerShell that reads the MSI file and retrieves the Product Code. The command to extract the GUID might look something like this:
Get-WmiObject -Query "SELECT * FROM Win32_Product WHERE Name = 'Your Application Name'" | Select-Object -Property IdentifyingNumber
This command queries the Windows Management Instrumentation (WMI) to find the application by its name and retrieves the associated Product Code. Alternatively, you could use a direct approach with the msiinfo command or a similar utility that can read the MSI properties.
Once we have successfully pulled the GUID, we can proceed to integrate it into our SCCM Application. The next step involves using the Add-CMScriptDeploymentType cmdlet, which is part of the SCCM PowerShell module. This command allows us to add a detection method to our application, ensuring that SCCM can verify if the application is installed on client machines by checking for the presence of the GUID.
The command to add the detection method may look something like this:
Add-CMScriptDeploymentType -ApplicationName "Your Application Name" -AddDetectionMethod -DetectionMethodType "Registry" -RegistryKey "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{Your-GUID}"
In this command, we specify the application name and the type of detection method we are adding. In this case, we are using a registry detection method, which checks for the existence of a registry key that corresponds to the GUID we extracted earlier. This registry key typically indicates whether the application has been successfully installed on a machine.
By implementing this detection method, SCCM can now accurately assess the deployment status of the application across all targeted devices. This not only helps in ensuring that the application is installed where it should be but also assists in reporting and compliance checks, making it an essential step in application lifecycle management.
In conclusion, pulling the GUID from an MSI and integrating it as a detection method in SCCM is a valuable practice that enhances application management. By following the outlined steps, including extracting the GUID and using the appropriate SCCM cmdlets, IT professionals can ensure effective application deployment and monitoring, leading to a more streamlined IT environment.
Query an MSI
Add-CMScriptDeploymentType