Jump to content


  • 0
anyweb

How can I exclude Start Menu items from being captured and restored using a custom file in USMT 4

Question

when doing a Refresh from Windows 7 to Windows 7 you may have programs installed on the source computer which are not installed on the destination even if it's the same computer, and as a result you don't want to migrate those unusable shortcuts in the start menu,

here's how you can exclude them and in addition exclude some additional items like files on the desktop (msi/exe) or desktop shortcuts.

  • create a custom XML file which you will use in addition to the default USMT xml files that are provided with USMT.
  • copy the below content into this blank XML file
  • save the file as WNB.XML

<?xml version="1.0" encoding="UTF-8"?>

<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/WNB">
   <!--WNB.xml is basically a customized version of MigUser.xml -->   
   <!-- This component EXCLUDES the following User specific stuff-->
   <component type="System" context="user">
       <displayName _locID="miguser.User_Exclusions">User Exclusions</displayName>
       <role role="Data">
           <rules>
               <unconditionalExclude>
                   <objectSet>

                   <!-- exclude blank links on the desktop-->    
                   <pattern type="File">%CSIDL_DESKTOP%\* [*.msi]</pattern>
                   <pattern type="File">%CSIDL_DESKTOP%\* [*.exe]</pattern>
                   <pattern type="File">%CSIDL_DESKTOP%\* [*.lnk]</pattern>
                   <pattern type="File">%CSIDL_DESKTOP%\* [*.lnk2]</pattern>

                   <pattern type="File">%CSIDL_DESKTOPDIRECTORY%\* [*.msi]</pattern>
                   <pattern type="File">%CSIDL_DESKTOPDIRECTORY%\* [*.exe]</pattern>
                   <pattern type="File">%CSIDL_DESKTOPDIRECTORY%\* [*.lnk]</pattern>
                   <pattern type="File">%CSIDL_DESKTOPDIRECTORY%\* [*.lnk2]</pattern>



                   <pattern type="File">%CSIDL_DEFAULT_DESKTOP%\* [*.msi]</pattern>
                   <pattern type="File">%CSIDL_DEFAULT_DESKTOP%\* [*.exe]</pattern>
                   <pattern type="File">%CSIDL_DEFAULT_DESKTOP%\* [*.lnk]</pattern>
                   <pattern type="File">%CSIDL_DEFAULT_DESKTOP%\* [*.lnk2]</pattern>


                   <pattern type="File">%CSIDL_DEFAULT_PROGRAMS%\* [*]</pattern>
                   <pattern type="File">%CSIDL_DEFAULT_STARTMENU%\* [*]</pattern>
                   <pattern type="File">%CSIDL_DEFAULT_STARTUP%\* [*]</pattern>
                   <pattern type="File">%CSIDL_PROGRAMS%\* [*]</pattern>   		                 
                   <pattern type="File">%CSIDL_STARTMENU%\* [*]</pattern>
                   <pattern type="File">%CSIDL_STARTUP%\* [*]</pattern>

                   </objectSet>
               </unconditionalExclude>
           </rules>
       </role>
   </component>

   <!-- This component EXCLUDES the following shared User specific stuff-->
   <component type="System" context="System">
       <displayName _locID="miguser.Shared_User_Exclusions">Shared User Exclusions</displayName>
       <role role="Data">
           <rules>
               <unconditionalExclude>
                   <objectSet>


                   <pattern type="File">%CSIDL_COMMON_DESKTOPDIRECTORY%\* [*.msi]</pattern>
                   <pattern type="File">%CSIDL_COMMON_DESKTOPDIRECTORY%\* [*.exe]</pattern>
                   <pattern type="File">%CSIDL_COMMON_DESKTOPDIRECTORY%\* [*.lnk]</pattern>
                   <pattern type="File">%CSIDL_COMMON_DESKTOPDIRECTORY%\* [*.lnk2]</pattern>



                   <pattern type="File">%CSIDL_COMMON_PROGRAMS%\* [*]</pattern>
                   <pattern type="File">%CSIDL_COMMON_STARTMENU%\* [*]</pattern>
                   <pattern type="File">%CSIDL_COMMON_STARTUP%\* [*]</pattern>

                   <pattern type="File">%CSIDL_PROGRAMS%\* [*]</pattern>   		                 
                   <pattern type="File">%CSIDL_STARTMENU%\* [*]</pattern>
                   <pattern type="File">%CSIDL_STARTUP%\* [*]</pattern>

                   </objectSet>
               </unconditionalExclude>
           </rules>
       </role>
   </component>
</migration>

 

wnb.xml

 

to use the file above, simply specify it in your Capture User State and Restore user State steps or manually specify it using i:\wnb.xml for example as below:-

 

C:\USMT\USMT\x64\scanstate.exe C:\USMTStores\OLD_COMPUTERNAME /c /o /nocompress /uel:30 /i:C:\USMT\USMT\x64\WNB.xml /i:C:\USMT\USMT\x64\MigApp.xml /i:C:\USMT\USMT\x64\MigUser.xml /config:C:\USMT\USMT\x64\Windows7_Config.xml /v:13 /l:C:\Windows\temp\scanstate.log /progress:C:\Windows\temp\scanstate_progress.log

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

I'm trying to use your XML file to exclude those empty start menu items that get migrated over. I have placed the XML into the root of my USMT 4 package on SCCM 2007 R3 and updated the DP. I then edited the task sequence step "Set USMT Additional Capture Options" and I have the following:

 

Task Sequence Variable: OSDMigrateAdditionalCaptureOptions

Value: /nocompress /hardlink /i:"%SYSTEMDRIVE%\_SMSTaskSequence\Packages\MyPackageNum\custom_excludes.xml"

 

This is the first customization I have attempted to make to the default USMT settings. I then ran the task sequence but the new XML file didn't seem to make any difference. I still see empty program folders from the previous OS. If I open the scanstate.log, I see this:

 

2012-03-02 16:36:37, Info [0x000000] Command line: C:\_SMSTaskSequence\Packages\SCG00053\x86\scanstate.exe C:\UserState /o /localonly /c /efs:copyraw /all /v:5 /l:C:\WINDOWS\system32\CCM\Logs\SMSTSLog\scanstate.log /progress:C:\WINDOWS\system32\CCM\Logs\SMSTSLog\scanstateprogress.log /i:C:\_SMSTaskSequence\Packages\SCG00053\x86\miguser.xml /i:C:\_SMSTaskSequence\Packages\SCG00053\x86\migapp.xml /nocompress /hardlink /i:C:\_SMSTaskSequence\Packages\SCG00053\custom_excludes.xml

 

So it appears that its referencing the right XML file. The scanstate log is HUGE, but I don't much in there as far as errors. Any ideas why the exclusions are not taking effect?

Share this post


Link to post
Share on other sites

  • 0

In that file - is it excluding all exe's and links on the desktop?

 

aren't you telling it to exclude any *.lnk and *.exe from the desktop and startmenu?

 

I'm assuming that should we want to only delete shortcuts we just remove that *.exe or comment the line out?

 

<unconditionalExclude>

<objectSet>

 

<!-- exclude blank links on the desktop-->

<pattern type="File">%CSIDL_DESKTOP%\* [*.msi]</pattern>

<pattern type="File">%CSIDL_DESKTOP%\* [*.exe]</pattern>

<pattern type="File">%CSIDL_DESKTOP%\* [*.lnk]</pattern>

<pattern type="File">%CSIDL_DESKTOP%\* [*.lnk2]</pattern>

<pattern type="File">%CSIDL_DESKTOPDIRECTORY%\* [*.msi]</pattern>

<pattern type="File">%CSIDL_DESKTOPDIRECTORY%\* [*.exe]</pattern>

<pattern type="File">%CSIDL_DESKTOPDIRECTORY%\* [*.lnk]</pattern>

<pattern type="File">%CSIDL_DESKTOPDIRECTORY%\* [*.lnk2]</pattern>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.