# Thursday, October 16, 2008

The answer is yes! Incidentally, is there really any limit to what you can do with ConfigMgr?? Well I suppose that is like asking, "How much wood could a woodchuck chuck if a woodchuck could chuck wood?", but anyway let's move on.

My first clue for solving this came from deployvista.com, "Using the $OEM$ folder with SCCM 2007 OS Deployments". To summarize you need to place your $OEM$ files into C:\_SMSTaskSequence\OSD\$OEM$ in order for Windows Setup to use the files. Here is what I did:

  1. Added my $OEM$ Files to my MDT Settings Package. (The one with unattend.txt, sysprep.inf and customsettings.ini)
  2. Add Z-CONFIG-CopyOEM.wsf to your MDT Source Files package. I've provided it below. (Remember to update DP)
  3. In your Task Sequence right before "Setup Windows and ConfigMgr" add a new "Run Command Line" task.
  4. Set the Name to "Copy OEM Files".
  5. Set the Command Line to "cscript.exe "%deployroot%\scripts\Z-CONFIG-CopyOEM.wsf".
  6. Click the "Package" checkbox and select your MDT Settings Package.
  7. All Done!

The guts of the script is pretty simple stuff and it works because when you set a Package in a Run Command Line Task the current directory is the path to whatever package you've select. In this case the current directory is the MDT Settings package containing our $OEM$ files.

'//----------------------------------------------------------------------------
'//  See if we can find the $OEM$ Directory
'//----------------------------------------------------------------------------
sDest = OEnvironment.GetOSDV4("_SMSTSMDATAPATH") & "\OSD\$OEM$"
oLogging.CreateEntry "$OEM$ Files will be copied to " & sDest, LogTypeInfo 

'//----------------------------------------------------------------------------
'//  Make sure the Destination exists
'//----------------------------------------------------------------------------
MKDir sDest 

'//----------------------------------------------------------------------------
'//  Get the Source Location and Copy the files
'//----------------------------------------------------------------------------
sSource = oShell.CurrentDirectory & "\$OEM$"
oLogging.CreateEntry "$OEM$ Files will be copied from " & sSource, LogTypeInfo 

'Copy the folder
oFSO.CopyFolder sSource, sDest 

 

All comments require the approval of the site owner before being displayed.
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview