Qué vas a conseguir
Una aplicación empaquetada en Microsoft Configuration Manager (MECM, antes SCCM) que se instala sola en los equipos de una colección, con un método de detección que evita reinstalarla, y los tres logs que te dicen por qué un equipo no la recibe.
Antes de empezar
- Rol de Application Administrator (o superior) en la consola de Configuration Manager.
- El instalador en un recurso compartido al que llegue el servidor de sitio:
\\cm01\Sources\Apps\7-Zip\24.08\. Una carpeta por aplicación y versión; nunca se sobrescribe una versión anterior. - Los parámetros de instalación silenciosa del fabricante. Para un MSI son estándar; para un EXE, los pone el fabricante (
/S,/quiet,/VERYSILENT). - Una colección de prueba con dos o tres equipos tuyos antes de cualquier colección real.
1. Probar la instalación silenciosa a mano
Antes de tocar la consola, el comando tiene que funcionar en un equipo limpio sin preguntar nada. Si no funciona a mano, no funcionará desde MECM.
msiexec /i "\\cm01\Sources\Apps\7-Zip\24.08\7z2408-x64.msi" /qn /norestart /l*v C:\Windows\Temp\7zip-install.log$LASTEXITCODE0Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" | Where-Object DisplayName -like "7-Zip*" | Select-Object DisplayName, DisplayVersion, UninstallStringDisplayName DisplayVersion UninstallString----------- -------------- ---------------7-Zip 24.08 (x64) 24.08 MsiExec.exe /I{23170F69-40C1-2702-2408-000001000000}Código de salida 0 (o 3010 si pide reinicio) y la entrada en el registro: eso es lo que MECM va a necesitar para saber que está instalada.
2. Crear la aplicación
Al importar un MSI, el asistente rellena el código de producto y el método de detección solo. Para un EXE tienes que escribirlos tú: el método de detección más fiable es la clave del registro de desinstalación con DisplayVersion igual o mayor que la versión que instalas.
Sin un método de detección correcto, MECM instala la aplicación en cada ciclo de evaluación o la marca como fallida aunque se haya instalado bien. Es el error número uno de los despliegues "que no funcionan".
3. Distribuir el contenido
Botón derecho sobre la aplicación → Distribuir contenido → el grupo de puntos de distribución. Hasta que el contenido no está en los DP, los clientes no pueden descargarlo. Se comprueba en Supervisión → Estado de distribución → Estado del contenido: tiene que estar al 100 % en verde.
4. Desplegar
Disponible la pone en el Centro de software para que el usuario la instale si quiere; Obligatorio con fecha límite la instala sola. Para el piloto, Obligatorio; para la colección real, primero Disponible una semana y después Obligatorio: así los usuarios ya la conocen cuando se les impone.
5. En el cliente: forzar y leer los logs
El cliente evalúa las políticas cada hora. Para no esperar:
# Pedir la política nueva y evaluar las aplicacionesInvoke-CimMethod -Namespace root\ccm -ClassName SMS_Client -MethodName TriggerSchedule -Arguments @{sScheduleID="{00000000-0000-0000-0000-000000000021}"}Invoke-CimMethod -Namespace root\ccm -ClassName SMS_Client -MethodName TriggerSchedule -Arguments @{sScheduleID="{00000000-0000-0000-0000-000000000121}"}# Los tres logs, en C:\Windows\CCM\Logs (ábrelos con CMTrace)Get-Content C:\Windows\CCM\Logs\AppEnforce.log -Tail 5 Performing detection of app deployment type 7-Zip 24.08 (x64)... App enforcement environment: ... Context: Machine ... Prepared command line: "C:\Windows\system32\msiexec.exe" /i "7z2408-x64.msi" /qn /norestart Matched exit code 0 to a Success entry in exit codes table. ++++++ App enforcement completed (5 seconds) ++++++- AppDiscovery.log: si el método de detección encuentra la app. "Not discovered" cuando sí está instalada = método de detección mal.
- AppEnforce.log: el comando que ejecutó y el código de salida. Un
1603es error genérico del MSI: abre el log delmsiexec(/l*v) para ver el motivo real. - CAS.log y ContentTransferManager.log: si no encuentra el contenido ("No DP locations found"), el equipo está en un límite sin DP asignado o el contenido no se distribuyó.
6. Qué poner en el ticket
Nombre de la aplicación, colección, nombre del equipo y las líneas de AppDiscovery y AppEnforce con la hora. Con eso, el administrador de MECM resuelve sin conectarse al equipo.
Siguientes pasos
- Convierte el EXE más usado del equipo en una aplicación con detección por registro: es el ejercicio que enseña el modelo entero.
- Añade requisitos (solo x64, solo Windows 11) y supersedencia (la versión nueva reemplaza a la vieja) cuando tengas dos versiones.
- En el Nivel 3 verás Intune y la coadministración: qué cargas de trabajo pasan a la nube y cuáles siguen en MECM.
¿Falta algo o en tu entorno es distinto? Escríbeme y lo corrijo.
What you'll get
An application packaged in Microsoft Configuration Manager (MECM, formerly SCCM) that installs itself on the devices in a collection, with a detection method that stops it reinstalling, and the three logs that tell you why a device isn't getting it.
Before you start
- The Application Administrator role (or higher) in the Configuration Manager console.
- The installer on a share the site server can reach:
\\cm01\Sources\Apps\7-Zip\24.08\. One folder per application and version; an earlier version is never overwritten. - The vendor's silent install parameters. For an MSI they are standard; for an EXE the vendor sets them (
/S,/quiet,/VERYSILENT). - A pilot collection with two or three of your own devices before any real collection.
1. Test the silent install by hand
Before touching the console, the command has to work on a clean device without asking anything. If it does not work by hand, it will not work from MECM.
msiexec /i "\\cm01\Sources\Apps\7-Zip\24.08\7z2408-x64.msi" /qn /norestart /l*v C:\Windows\Temp\7zip-install.log$LASTEXITCODE0Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" | Where-Object DisplayName -like "7-Zip*" | Select-Object DisplayName, DisplayVersion, UninstallStringDisplayName DisplayVersion UninstallString----------- -------------- ---------------7-Zip 24.08 (x64) 24.08 MsiExec.exe /I{23170F69-40C1-2702-2408-000001000000}Exit code 0 (or 3010 if it asks for a reboot) and the registry entry: that is what MECM will need to know it is installed.
2. Create the application
When importing an MSI, the wizard fills in the product code and the detection method on its own. For an EXE you write them yourself: the most reliable detection method is the uninstall registry key with DisplayVersion equal to or greater than the version you install.
Without a correct detection method, MECM installs the application on every evaluation cycle, or marks it failed even though it installed fine. It is the number one cause of deployments "that don't work".
3. Distribute the content
Right-click the application → Distribute Content → the distribution point group. Until the content is on the DPs, clients cannot download it. Check it under Monitoring → Distribution Status → Content Status: it has to be 100% green.
4. Deploy
Available puts it in Software Center for the user to install if they want; Required with a deadline installs it on its own. For the pilot, Required; for the real collection, Available for a week first and then Required: users already know it by the time it is enforced.
5. On the client: force it and read the logs
The client evaluates policies every hour. To avoid waiting:
# Request the new policy and evaluate applicationsInvoke-CimMethod -Namespace root\ccm -ClassName SMS_Client -MethodName TriggerSchedule -Arguments @{sScheduleID="{00000000-0000-0000-0000-000000000021}"}Invoke-CimMethod -Namespace root\ccm -ClassName SMS_Client -MethodName TriggerSchedule -Arguments @{sScheduleID="{00000000-0000-0000-0000-000000000121}"}# The three logs, in C:\Windows\CCM\Logs (open them with CMTrace)Get-Content C:\Windows\CCM\Logs\AppEnforce.log -Tail 5 Performing detection of app deployment type 7-Zip 24.08 (x64)... App enforcement environment: ... Context: Machine ... Prepared command line: "C:\Windows\system32\msiexec.exe" /i "7z2408-x64.msi" /qn /norestart Matched exit code 0 to a Success entry in exit codes table. ++++++ App enforcement completed (5 seconds) ++++++- AppDiscovery.log: whether the detection method finds the app. "Not discovered" when it is installed = detection method wrong.
- AppEnforce.log: the command it ran and the exit code. A
1603is the MSI's generic error: open themsiexeclog (/l*v) for the real reason. - CAS.log and ContentTransferManager.log: if it cannot find the content ("No DP locations found"), the device is in a boundary with no DP assigned, or the content was not distributed.
6. What to put in the ticket
Application name, collection, device name and the AppDiscovery and AppEnforce lines with the time. With that, the MECM administrator resolves it without connecting to the device.
Next steps
- Turn the team's most used EXE into an application with registry detection: it is the exercise that teaches the whole model.
- Add requirements (x64 only, Windows 11 only) and supersedence (the new version replaces the old one) once you have two versions.
- In Level 3 you'll see Intune and co-management: which workloads move to the cloud and which stay in MECM.
Is something missing, or different in your environment? Get in touch and I'll fix it.
Tech Career Lab · newsletter
¿Te ha servido? Cada dos semanas envío una idea práctica para perfiles IT: LinkedIn, proyectos, networking y procesos de selección.Found this useful? Every two weeks I send one practical idea for IT professionals: LinkedIn, projects, networking and hiring processes.
Apúntate y llévate las 33 ideasSign up and get the 33 ideas →