• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. Steve Dearman
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    Steve Dearman

    @Steve Dearman

    0
    Reputation
    164
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Steve Dearman Unfollow Follow

    Latest posts made by Steve Dearman

    • RE: Windows 7: How to avoid manually activating each machine after deployment.

      This is similar to the problem I have 50 oem machines with label keys on top so I created a script to read the serial number from the bios and change the key and activate.

      [CODE]’ Use “wmic bios get serialnumber” to get the serial number if its not documented elsewhere.
      Dim sSerial
      Dim sKey
      set cnn = createobject(“adodb.connection”)
      set rs = createobject(“adodb.recordset”)
      Set objWMIService = GetObject(“winmgmts:” _
      & “{impersonationLevel=impersonate}!\.\root\cimv2”)
      Set colBIOS = objWMIService.ExecQuery _
      (“Select * from Win32_BIOS”)
      For each objBIOS in colBIOS
      sSerial = objBIOS.SerialNumber
      Next
      cnn.open “Provider=Microsoft.Jet.OLEDB.4.0; Data Source=.; Extended Properties=”“text;HDR=Yes;”“”
      rs.open “select * from serials.csv where Serial='” & sSerial & “'”, cnn, 3, 3

      Do until rs.eof
      sKey = rs.fields.item(“key”).value
      rs.MoveNext
      loop
      If Not IsEmpty(sKey) Then
      Dim objShell
      Set objShell = Wscript.CreateObject(“WScript.Shell”)
      objShell.Run "c:\windows\system32\cscript c:\windows\system32\slmgr.vbs /ipk " & sKey,1,TRUE
      objShell.Run “c:\windows\system32\cscript c:\windows\system32\slmgr.vbs /ato”,1,TRUE
      Set objShell = Nothing
      End If

      [/CODE]

      This reads a csv file called serials so its easy to update.

      [CODE]Serial,Key
      HKCF91LC102731,abcde-fghij-klmno-pqrst-uvwxy
      [/CODE]

      I call this from the setupcomplete.cmd as outlined in the main windows 7 fog guide so everything is activated with the correct key right from the word go

      posted in Windows Problems
      S
      Steve Dearman