Multi-OEM Window 7 Sysprep image with automatic activation.

Discussion in 'Windows 7' started by Thurge, Dec 11, 2013.

  1. Thurge

    Thurge MDL Novice

    Apr 9, 2011
    6
    1
    0
    Hi,

    I've been scouring the MDL forums for a solution to this problem. I've created a great system image that works on any Dell computer. All I have to do is add additional drivers for any new model Dell and the image works. Our default hardware is Dell but we recently aquired another company and their default hardware is Lenovo. We also have a handful of other Non-Dell hardware in the company. Our goal is to add support for automatic activation on Non-Dell systems. I have the *.xrm-ms files for each of the OEM's that we support. I examined the "Multi-OEM install DVD files" and found a folder with all of the certificates for all of the OEM's we support (and then some.) I also found the following post that I think is almost my answer.

    I need to know how do I make this work? If I put all the certs in the OEM folder then they'd have to have different names, obviously. Will windows ignore the different names and just try each file until one of them works? Also, even though I'm pretty sharp, I'm not quite sure what Flipp3r meant by "win7 OA keys." Did he mean the OEM Activation keys? If so where would I put them? All of our computers have the correct slp bios for their respective OEM so I don't need any bios tricks It should just pull the key from the bios right? I know I can bypass all this with a Volume License Product key but alas my boss said no to that. Looking forward to solving this problem.
     
  2. f33nix

    f33nix MDL Member

    Apr 4, 2012
    153
    84
    10
    By reading this forum you should be able to make this happen... I did and it is almost something a child could do.

    I made 3 disks for Windows 7 multi-OEM
    1. Windows 7 SP1 32-bit & 64-bit on one disk (no Windows updates applied and less than 4.7GB)
    2. Windows 7 SP1 32-bit with updates integrated to November 2013
    3. Windows 7 SP1 64-bit with updates integrated to November 2013

    Here is a link to get you started.
    http://forums.mydigitallife.net/threads/15733-Windows-7-DVD-(Multi-Brand-Multi-Edition)-Activation
     
  3. Thurge

    Thurge MDL Novice

    Apr 9, 2011
    6
    1
    0
    Sorry f33nix I'm not talking about creating a Windows Install DVD. I'm talking about a system image. You know you install Windows, then run sysprep, boot the machine with winPE, and take an image using gimagex (kinda like ghost but from MS.) I can then deploy that image to other machines. As long as it is a Dell and has the right bios it will activate windows automatically. If I install this image on a non dell machine I'll get the "windows is not valid" message. What I want to do is make "One Image to Rule Them All!" So that I can slipstream the drivers of any new machine into my image, and add the SLP files it needs and then it works without any errors.

    Comprende?
     
  4. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,458
    982
    60
    #4 Humphrey, Dec 12, 2013
    Last edited by a moderator: Apr 20, 2017
    I wouldn't do that unless you wanted drivers from dell on lenovo and so on.. The Windows 7 DVD (Multi-Brand/Multi-Edition) Activation thread/script will allow for OEM activation of ANY OEM- not just dell/lenovo.

    Ive got a rip of a verizon/bestbuy kiosk install usb and it has it setup so that the install.wim is made custom for a machine and when you put the USB in to boot- it checks to see what the model/make is of said machine and then applies the appropriate image.

    Here is the text file it checks against:

    As you can see it was used on many different computers all requiring different drivers and setups. Juts pop in the USB and it well install the correct image.

    And here is the vb script that ran to put it all to work:

    Code:
    '==========================================================================
    '
    ' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 4.1
    '
    ' NAME: 
    '
    ' AUTHOR: Verizon Wireless , Verizon Wireless
    ' DATE  : 5/26/2010
    '
    ' COMMENT: 
    '
    '==========================================================================
    
    'Getinfo.vbs - used to get information on your computer
    '
    
    Dim strComputer, objWMIService, colSettings, intProc
    Dim WshShell,fso,F4,F1,F2,F3,A1,A2,model,DiskVolume,Drive
    Dim P1,P2,P3,P4,P5,P6,File1,Cmdline,S1,S2,S3,S4,X1,X2,X3,X4
    Dim colDrives,objDrive,GoodToGo,HoldLine,CMD,ImageXInfo,FormatInfo
    Dim HaveVolume,Logfile,ReturnCode,HModel
    
    Const ForReading = 1, ForWriting = 2, ForAppending = 8
    On Error Resume Next
    strComputer = "."
    
    ' Attach to WMI
    
    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colSettings = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
    Set WshShell = WScript.CreateObject("WScript.Shell")
    Set fso = CreateObject("Scripting.FileSystemObject")
    
    Set colSettings = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")
    
    
    ' ************ Get USB drive and volume ********************************
    
    GoodToGo = False
    Set colDrives = fso.Drives
    For Each objDrive in colDrives
        'Wscript.Echo "Drive letter: " & objDrive.DriveLetter
        File1 = objDrive.DriveLetter & ":\scripts\ImageMe.Vbs"
        If fso.FileExists(File1) Then
           'WScript.echo "Volume Name: " & objDrive.VolumeName
           DiskVolume = UCASE(objDrive.VolumeName)
           Drive = objDrive.DriveLetter & ":"
           GoodToGo = True
        End If
    Next
    
    '************** Open logfile to track progress.
    If GoodToGo = True Then 
       GoodToGo = False
       Logfile = Drive & "\scripts\ImageMe.Log"
       Set F1 = fso.OpenTextFile(Logfile,ForWriting,True) 
       If Err.Number = 0 Then
          F1.WriteLine Now & " *************** Start the Image process *************"
          GoodToGo = True
       Else
          WScript.Echo "Could not open " & Logfile & " for logging stopping" 
       End If
    End If
       
    ' ************** Get computer model number this will tell us which image to use. 
    If GoodToGo = True Then
       GoodToGo = False
       model = "Model Not In WMI"
       For Each objComputer In colSettings 
          model = UCASE(objComputer.Model)
       Next
    End If
    F1.WriteLine Now & " WMI states Model = " & model
    
    If model <> "Model Not In WMI" Then
       GoodToGo = True
    End If
      
    '***********  Get imaging commands test files. 
    
    If GoodToGo = True Then
       GoodToGo = False
       Call ReadImageInfo()
    End If
    
    '************* Let Partition the drive *******************
    If GoodToGo = True Then
       GoodToGo = False
       Cmdline = "Cmd /c diskpart.exe /s " & FormatInfo
       F1.WriteLine Now & " Open DiskPart CMD window = " & Cmdline
       ReturnCode = WshShell.Run(Cmdline,1,True)
       If ReturnCode = 0 Then
          F1.WriteLine " Drive should be setup and partitioned"
          GoodToGo = True
       Else
          Err.Raise(ReturnCode)
          F1.WriteLine Now & " Format failed - " & Err.Description
       End If
    End If
    
    If GoodToGo = True Then 
       GoodToGo = False
       Cmdline = "Cmd /c " & ImageXInfo
       F1.WriteLine Now & " Submit Imagex cmd file - contains imagex and bcdedit commands"
       F1.WriteLine Now & "    Image Cmd File = " & ImageXInfo
       Returncode = WshShell.Run(Cmdline,1,True)
       If Not fso.FileExists(Drive & "\scripts\ErrorImage.txt") Then 
          GoodToGo = True
          F1.WriteLine Now & " ******** Drive is imaged *************"
       Else
          F1.WriteLine Now & " **** image commands failed with errors = "
          WScript.Echo "Image commands did not complete check file : " & logfile 
       End If
       'Call ProcessImageXcmds()
    End If
    
    If GoodToGo = True Then 
       F1.WriteLine Now 
       F1.WriteLine Now & " ************ Process completed no errors ************"
       F1.WriteLine Now & "              Submit shutdown as last task"
       Cmdline = "cmd /k Echo **** Process completed shutdown summitted ****" 
       ReturnCode = WshShell.Run(Cmdline,1,False)
    Else
       WScript.Echo "Process has errors - Review Logfile = " & Logfile & VbCrLf & " ** Type Exit to shutdown **"
       GoodToGo = False
    End If
    
    F1.Close
    
    If GoodToGo = True Then    'Submit shutdown
       WScript.Sleep 15 * 1000  ' Give user chance to read message
       Cmdline = "CMD /C wpeutil shutdown"
       ReturnCode = WshShell.Run(Cmdline,0,False)
    End If
         
    
    Function ReadImageInfo()
    
    File1 = Drive & "\scripts\ImageInfo.txt"
    HaveVolume = False
    
    F1.WriteLine Now & " About to open " & File1
    
     X1 = 0 ' Once a match is made toss the rest of the edits. 
     
    If fso.FileExists(File1) Then
       Set F2 = fso.OpenTextFile(File1,ForReading)
       Do Until F2.AtEndOfStream
         HoldLine = Ucase(F2.Readline)
         If X1 = 0 Then ' continue to test input for model match up
          A1 = Split(HoldLine,",",-1,1)
          HModel = InStr(1,model,A1(0),1) 
          If HModel <> 0 Then 
             F1.WriteLine Now & " Input and WMI model match " & UCase(A1(0)) & " " & model
             X1 = 1 
             If UBound(A1) = 3 Then
                FormatInfo = Drive & A1(1) & A1(2)
                ImageXInfo = Drive & A1(1) & A1(3) 
                If fso.FileExists(ImageXInfo) Then
                   If fso.FileExists(FormatInfo) Then
                      F1.WriteLine Now & " Needed files exits continue " 
                      F1.WriteLine Now & "   Ximage CMD File   = " & ImageXInfo
                      F1.WriteLine Now & "   DiskPart CMD File = " & FormatInfo 
                      GoodToGo = True
                   Else
                      F1.WriteLine Now & " Required File Not found " &  FormatInfo
                   End If
                Else
                   F1.WriteLine Now & " Required File Not found " &  ImageXInfo
                End If
             Else
                F1.WriteLine Now & " Need images path, partitions file,and imagex file check input file"
             End If
           End If
         End If    
       Loop
       F2.Close
    End If
    
    If X1 = 0 Then 
       F1.WriteLine Now & " No MATCHING Model found in input file - Stopping"
    End If
       
     End Function
    '************ Read in the imagex.txt file file has  
     Function ProcessImageXcmds()
    
    
    '*******************************************************
    ' File contains imagex cmds followed with any BCDEDIT commands
    '*******************************************************
    
    Set F3 = fso.OpenTextFile(ImageXInfo,ForReading)
    
    X1 = 0 'set if any returncodes not = 0
    
    ' Test that file opened
    If Err.Number <> 0 Then 
       F1.WriteLine Now & " Could not open file - " & ImageXInfo
    Else
       F1.WriteLine Now & " Opened input file - " & ImageXInfo
       GoodToGo = True
    End If
    
    ' Read and submit cmd window for each line in file. 
    If GoodToGo = True Then
       GoodToGo = False
       Do Until F3.AtEndOfStream
       Cmdline = F3.ReadLine
       F1.WriteLine Now & " ** CMD = " & Cmdline
       If Ucase(Mid(Cmdline,1,3)) <> "REM" Then  ' Remarks line bypass
          ReturnCode = WshShell.Run(Cmdline,1,True)
          If ReturnCode = 0 Then 
            F1.WriteLine Now & "    --Completed--"
          Else
            Err.Raise(ReturnCode)
            F1.WriteLine Now & "    --Failed--" & Err.Description
            X1 = X1 + 1
          End If
       End If
       Loop
       F3.Close
    End If
    
    If X1 <> 0 Then    ' one of the cmd lines failed
      F1.Writeline Now & " ************* one or more cmd executions failed ************"
    Else
      GoodToGo = True
      F1.WriteLine Now & " ************* Drive should be imaged and ready to go *******"
    End If
    
    End Function
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. ar_seven_am

    ar_seven_am MDL Senior Member

    Mar 7, 2010
    392
    125
    10
    #5 ar_seven_am, Dec 12, 2013
    Last edited: Dec 13, 2013
    if u only want to inject the dell certificate without need to add others, u dont need to sysprep the image, u can try to use MJ tool HERE

    u need to change the title, should be DELL OEM Image, not MULTI OEM...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. f33nix

    f33nix MDL Member

    Apr 4, 2012
    153
    84
    10
    Sorry Mr Thurge if somehow I got wrong end of stick.

    I am not sure I would mix the 2 different brands like you talk about trying to do, I would keep them seperate.
    There are several ways to approach this problem. You could create the disks like I say and use setupcomplete.cmd to add-in drivers/programs and such that you need; as we say there are more than one way to skin a cat (not meant to offend cat lovers!)


    But if you want then Mr Humphrey seems to have a nice neat solution that should be powerful enough for your needs.
    Otherwise investigate Mr ar_seven_am's other advice.
     
  7. Thurge

    Thurge MDL Novice

    Apr 9, 2011
    6
    1
    0
    #7 Thurge, Dec 12, 2013
    Last edited: Dec 12, 2013
    (OP)
    Hmm,

    Maybe, I'm not explaining this well enough. Okay...

    I have an image that works on all the different Dell models we have in our organization. It works because the drivers for each model we support have been "injected" into the image. Sysprep is required so that Windows will plug and play the correct HAL and other drivers. This image will be used to deploy new systems. What I want to do is "inject" drivers for non-Dell OEM computers (thus making it a Multi-OEM image.) I have already injected the drivers for our Lenovo systems for instance. What I'm trying to figure out is what do I need to add to the image so that automatic activation works on it? For OEM automatic activation to work you need 3 things: 1.) a bios that has the OEM SLP data in it, 2.) The OEM certificate (this is the *.wrm-ms file found in c:\windows\system32\oem) 3. The OEM Key.

    Wow! While I was composing this response I installed the image on a Lenovo. Before I did this I replaced the oem.xrm-ms file with 3 different files: a Dell version called dell.xrm-ms, a Lenovo version called lenovo.xrm-ms, and an Asus version called asus.xrm-ms. The image just finished configuring itself and it's activated!!!!

    ONE IMAGE TO RULE THEM ALL!!!

    I guess the initial post I quoted was right... Thanks for the input guys but it looks like I had already found the solution!!!!
     
  8. urie

    urie Moderator
    Staff Member

    May 21, 2007
    8,717
    3,084
    300
    @ Thurge. yes you can add all oem.xrm-ms certificates into $OEM$ folder and as OEM:SLP serial number are not totally brand specific say ultimate then OEM:SLP key will activate but not good practice been like that since vista.
     
  9. Thurge

    Thurge MDL Novice

    Apr 9, 2011
    6
    1
    0
    Is there a potential downside to doing it this way? Also, I was wondering if there was some automated way to change the OEM product key to the correct one? I was thinking of writing a batch file or vbs file that could be called by Setupcomplete.cmd. It would then prompt with a list of your OEMs for you to select and then install the correct key using slmgr.vbs. This way the product key would match the machine. Not sure if that matters but I'd like it to be consistent.
     
  10. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,458
    982
    60
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. Thurge

    Thurge MDL Novice

    Apr 9, 2011
    6
    1
    0
    Why do people keep pointing out this thread to me??? This is totally different topic.
     
  12. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,458
    982
    60
    #12 Humphrey, Dec 13, 2013
    Last edited: Dec 13, 2013
    It is what you need. Why recreate something that has already been written and I would even say it has been done damn good.

    It does this. By adding the $oem$ to the sources folder, your OEM computer is activated against the OEM cert and serial that is needed for the computer. (Not that the OEM serials are specific, cause they aren't. Lenovo Home Premium serial will work on Dell Home Premium.)

    Its all written in batch, except the parts that are not doable in batch- it uses OOBE.CMD.

    No need for a prompt, this checks what OEM the computer is and applies the cert/serial for it- no user interaction required.

    So unless you're just super terrible at explaining what it is that you want, I suggest you make your Install.wim and use http://forums.mydigitallife.net/threads/15733]THIS[/url] to activate via OEM on your computers. If for some reason you do not want all those other OEM's data taking up space, just delete the certs/themes you do not want.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. ar_seven_am

    ar_seven_am MDL Senior Member

    Mar 7, 2010
    392
    125
    10
    What I do remember the activation check from OOBE, while u want to deploy the image with sysprep which will restore to default (non activated)...

    that's is why most answer pointed to that thread for multi oem install image...

    please correct me if I'm wrong...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,458
    982
    60
    I think it was when you either Syspreped the image or only when you had it generalized- that it removes the activation then.


    Back to what I was saying Here - He could use the scripts in the Multi-OEM activator by searchengine to apply the drivers without having to inject them.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. ar_seven_am

    ar_seven_am MDL Senior Member

    Mar 7, 2010
    392
    125
    10
    #15 ar_seven_am, Dec 13, 2013
    Last edited: Dec 13, 2013
    yes humprey, u're correct, the sysprep method work different, is not for system activation...

    also humprey, sysprep is generalize in audit phase, and it's before OOBE, right?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,458
    982
    60
    Well, if you mean OOBE as the screen where you enter your/computer name and setup the computer right before you enter the desktop for the first time, then yes.

    Just press Control + Shift + F3 at that screen and the computer will restart, putting you into the administrators desktop so that you can customize the system.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. Thurge

    Thurge MDL Novice

    Apr 9, 2011
    6
    1
    0
    #17 Thurge, Dec 13, 2013
    Last edited: Dec 13, 2013
    (OP)
    Humphrey,

    By adding the .xrm-ms files for each vendor to the oem folder it activates perfectly. No need for any scripts. I just wanted a way to make the installed OEM Product Key (which is currently the Dell Key) match the actual OEM of the machine. I know the Dell OEM master product key will activate other OEM's as long as the OEM cert and Bios data match but for auditing purposes I thought it would be a good idea to change it to the correct Product Key that each OEM builds into their system.

    I was thinking of making a set of batch files that would be run manually after the image has finished with oobe. Each batch file would be named by the oem: Dell.bat, Lenovo.bat, etc. Then our tech could run the batch file based on the vendor and it would run the following two commands:

    1. [slmgr.vbs -ipk <OEM product key goes here>]
    2. [slmgr.vbs -ato]
     
  18. urie

    urie Moderator
    Staff Member

    May 21, 2007
    8,717
    3,084
    300
    @ Thurge, yes I already said that will work but it is not good practice windows will go through every manufacturer certificate until it finds the correct one.

    And your pkeyconfig.xrm-ms file will probably include every file searched for rather than using a script that will check you system for oem info and install only correct certificate my dell pkeyconfig.xrm-ms is only 995 KB (1,018,920 bytes) check the size of yours after you have used multiple .xrm-ms certificates to see result.

    I may be wrong here but I'm certain either FreeStyler or Sebus and I had this conversation years back in the early vista OEM:SLP activation days.

    anyway you have been pointed to Multi-OEM activator by searchengine it is a script at least have a look at it.
     
  19. alzeric

    alzeric MDL Novice

    Dec 16, 2013
    4
    1
    0
    Word of advice on the new hardware. Run! Run far far away from Lenovo equipment, I inherited a bunch of I3 and I5 Lenovo desktops when I was hired on as the Director of IT at my firm. Every single Lenovo has issues, either random freezing or sluggish behavior even if I wipe them and install a fresh Win 7 ISO (keep in mind the only software that is getting installed on these computers is Office). If you have any say on the purchasing in your company I would strongly suggest finding a different vendor.