I’ve been using USMT via OSD to migrate user profiles and settings using a zero-touch approach with no user interaction at all. This was working fine but I thought it would be nice if as well as user data, it also migrated applications. The UDI wizard discovery and selection page is a nice feature but I wanted it to be zero-touch, so I decided I’d incorporate the same discovery and selection but without displaying the wizard. This way, I could still use the same rules and mappings and the UDI wizard designer UI to control the migration behaviour, but without displaying the wizard to the user.
The way this was accomplished was pretty easy, it just required 3 new task sequence steps in place of the UDI Wizard call and a custom vb script.
The first step calls the AppDiscovery executable just like the UDI wizard does, and passes it the required parameters.
Command Line: AppDiscovery.exe /readcfg:”%scriptroot%\UDIWizard_Config.xml.app” /writecfg:”%temp%\AppDiscoveryresult.xml.app” /log:”%temp%\AppDiscovery.log”
Where /readcfg points to the location of the Configuration XML from UDI, /writecfg points to the location to write the discovery XML and /log points to the location to create the log file.
Start In: %deployroot%\tools\osdresults
The second step runs the custom vbscript which reads the XML file generated by AppDiscovery.exe, finds the applications that were detected and selected, and then sets them to their respective task sequence variables.
Command Line: cscript.exe “%ScriptRoot%\Custom\SetAppVariables.vbs” “%temp%\AppDiscoveryresult.xml.app” 64
Where ‘Custom’ is the name of a custom folder within the MDT Files Package ‘Scripts’ folder, AppDiscoveryresult.xml.app is the same as the /writecfg switch in the ‘Run AppDiscovery’ step above, and 64 is the architecture of the Operating System being deployed.
The third step runs one of the built-in UDI scripts to serialize the XML file which sets the task sequence variable ‘ApplicationList’ from the XML file contents.
Command Line: cscript.exe “%deployroot%\tools\osdresults\OSD_SerializeXmlApp.vbs” > “%temp%\SerializeXmlApp.log”
A link to the vbscript can be found Here (in .txt format to allow upload – save or rename to .vbs)