Unanswered Where to update registry keys during bootup

  • Thursday, February 07, 2013 12:50 AM
     
     

    I'm trying to pull information from an external database and pre populate the Computer Name field in MDT 2012. I have pieced together the script and everything is functional but I keep getting an error that says: 

    Safety settings on this computer prohibit accessing a data source on another domain.

    Which is fine, I've found the registry keys as well as the VBScript code to fix this. Here they are:

    oShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\ProtocolDefaults\file", 0, "REG_DWORD"

    oShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\ProtocolDefaults\http", 0, "REG_DWORD"

    The problem I'm having is where in the process to place this code for it to affect the registry correctly. When I place it in DeployWiz_ComputerName.vbs I have to restart LiteTouch.wsf in order for it to work correctly. And I've tried many different places inside LiteTouch.wsf as well as LiteTouch.vbs but it just doesn't seem to do anything at all. 

    Is there a specific point during bootup where I need to insert the registry key updates to get them to "take" on the first go?

All Replies

  • Thursday, February 07, 2013 8:47 PM
     
     

    What are you tying machine names to in the Database? to somethign like a asset tag/serial number or a mac address? etc.

    there are several ways to automate the naming of the workstation... depending on what your format is.


    ~Shadster

  • Thursday, February 07, 2013 9:05 PM
     
     

    I'm trying to name it off of our own asset tags. We have a database linking the computer Serial Number to our asset tag (different than the one's associated with the computer) which is why I'm trying to run this query.

    So I've implemented a super ugly work around, I don't know if anyone else has a smoother way to "restart" LiteTouch.vbs but I inserted this script into DeployWiz_SelectTS.vbs:

    Dim RegKey

    RegKey = oShell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\ProtocolDefaults\file")

    If RegKey=3 Then

    '' Script to change registry keys I posted above

    o.Shell.Run "LiteTouch.wsf"

    window.close

    End If

    Like I said this is really ugly. It Basically loads into the selection wizard, displays an error message, and restarts everything with the correct registry values. Functional, but surely there has gotta be a better way to do this.


    • Edited by legofneb2 Thursday, February 07, 2013 9:05 PM
    •  
  • Thursday, February 07, 2013 9:12 PM
     
     

    how many machines are we talking about... hundreds, thousands or more?

    have you tried mounting your lite touch wim and hacking the pe registry directly... 

    kinda like this: "http://myitforum.com/cs2/blogs/sbequette/archive/2011/05/16/how-to-edit-the-registry-on-winpe.aspx"


    ~Shadster

  • Thursday, February 07, 2013 9:24 PM
     
     
    100 per month. I was hoping to avoid touching the winpe image in case I need to add drivers. But for the amount of work I've done so far that wouldn't be such a bad thing to have to do after each driver update. Thank you for the link.