10 Replies Latest reply on Sep 13, 2010 12:00 PM by brandonhyde

    Windows 7, provisioning and computer name

    Apprentice

      Normally when I want a windows XP device to change its computer name when provisioning I inject changes in the sysprep.inf file by injecting the change via  the script inejction. basically I modifiy the sysprep we want including the

      %ldHostname% variable.In windows 7 I am having problems getting this to work with the unattended.xml file.. is anyone else seeing this issue.. ?  
        • 1. Re: Windows 7, provisioning and computer name
          Apprentice

          <?xml version='1.0' encoding='utf-8'?>
          <unattend xmlns="urn:schemas-microsoft-com:unattend">
            <settings pass="auditSystem">
              <component name="Microsoft-Windows-PnpCustomizationsNonWinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
              </component>
              <component name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
              </component>
            </settings>
            <settings pass="specialize">
              <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
                <Identification>
                  <JoinDomain>changed</JoinDomain>
                  <Credentials>
                    <Domain>Changed for securityT</Domain>
                    <Username>Changed for securtiy</Username>
                    <Password>changed for security</Password>
                  </Credentials>
                </Identification>
              </component>
              <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
                <RegisteredOrganization>Dartmouth College</RegisteredOrganization>
                <RegisteredOwner>Public Computer</RegisteredOwner>
                <ComputerName>%ldHostname%</ComputerName>
              </component>
              <component name="Microsoft-Windows-Deployment" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
                <RunSynchronous>
                  <RunSynchronousCommand wcm:action="add">
                    <Description>UIU-COMMAND-ID={4dec1d91-5b7c-4f41-91e1-ee8d57db943e}</Description>
                    <Order>1</Order>
                    <Path>reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 00000000 /f</Path>
                  </RunSynchronousCommand>
                </RunSynchronous>
              </component>
            </settings>
            <settings pass="oobeSystem">
              <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
                <UserAccounts>
                  <AdministratorPassword>
                          <PlainText>true</PlainText>
                  </AdministratorPassword>
                </UserAccounts>
                <AutoLogon>
                  <Enabled>false</Enabled>
                </AutoLogon>
                <Display>
                  <ColorDepth>16</ColorDepth>
                  <HorizontalResolution>1024</HorizontalResolution>
                  <RefreshRate>60</RefreshRate>
                  <VerticalResolution>768</VerticalResolution>
                </Display>
                <OOBE>
                  <HideEULAPage>true</HideEULAPage>
                  <SkipMachineOOBE>true</SkipMachineOOBE>
                  <SkipUserOOBE>true</SkipUserOOBE>
                  <NetworkLocation>Work</NetworkLocation>
                </OOBE>
                <TimeZone>Eastern Standard Time</TimeZone>
              </component>
              <component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <SystemLocale>en-US</SystemLocale>
              </component>
            </settings>
          </unattend>

          • 2. Re: Windows 7, provisioning and computer name
            Apprentice

            Have you gotten a response on this. I'm having the same sort of issue.

            • 3. Re: Windows 7, provisioning and computer name
              Apprentice

              I am doing this today:

               

              Take out the CTOS action from the template so the machine stays in WinPE. The template will fail, however, you should be able to browse to the d: drive where the unattend.xml resides and verify that the variables did get successfully replaced.

               

              Once you verify that send me you unattend.xml as well as the sysprep log files from \Windows\Panther\Sysprep\UnattendGC. Logs are called setupact.log and setuperr.log.

              • 4. Re: Windows 7, provisioning and computer name
                Apprentice

                So I have verified after I was in the OS that the variables did receive their proper values. Meaning, %ldHostname% changed in the Unattend to whatever the hostname is.

                 

                Let me know what you think.

                • 5. Re: Windows 7, provisioning and computer name
                  Apprentice

                  We've been having issues with this too and, from the testing we've done, I think sysprep in Win7 works a little differently than WinXP.  The computer name in the XML file is somehow "committed" and, even if you change it via a variable, that change doesn't happen when sysprep actually runs.  I've verified this by completely removing the computer name line in the xml file...which should cause sysprep to stop and prompt for the name, but it doesn't.  Anyways, I'm trying to use a VB script to change the pc name after it boots into windows.  If you're interested in the method, let me know.

                  • 6. Re: Windows 7, provisioning and computer name
                    Apprentice

                    Has this been confirmed by Microsoft. For me I completely do not understand why the Unattend.xml file wouldn't be able to change the computer name. This is the purpose of the file.

                    • 7. Re: Windows 7, provisioning and computer name
                      Apprentice

                      If you get it to wokr let me know... I am scrtching my head on this. 

                      • 8. Re: Windows 7, provisioning and computer name
                        Apprentice

                        below is the VBScript that we're using.  Basically what it does is check to see if LANDesk was able to insert the computer name into the script and, if not, let Sysprep give it a default name.  Note: You have to include a Replace Text Action in your template that replaces "VARIABLEPLACEHOLDER" WITH %ldHostname%.

                         

                        sNewName = "VARIABLEPLACEHOLDER"

                        If "VARIABLEPLACEHOLDER" = "" Then

                        Else

                        Set oShell = CreateObject ("WSCript.shell" )

                        sCCS = "HKLM\SYSTEM\CurrentControlSet\"
                        sTcpipParamsRegPath = sCCS & "Services\Tcpip\Parameters\"
                        sCompNameRegPath = sCCS & "Control\ComputerName\"

                        With oShell
                        .RegDelete sTcpipParamsRegPath & "Hostname"
                        .RegDelete sTcpipParamsRegPath & "NV Hostname"

                        .RegWrite sCompNameRegPath & "ComputerName\ComputerName", sNewName
                        .RegWrite sCompNameRegPath & "ActiveComputerName\ComputerName", sNewName
                        .RegWrite sTcpipParamsRegPath & "Hostname", sNewName
                        .RegWrite sTcpipParamsRegPath & "NV Hostname", sNewName
                        End With ' oShell

                        End If

                        • 9. Re: Windows 7, provisioning and computer name
                          Apprentice

                          Quick question.. I know its stupid but I have never injected a VBS script.. do you jsut copy the text of your scrpt into notepad then save as .*.VBS and then inject that? I am sure yest but just checking....

                           

                          Thanks for you work on this!!!! 

                          • 10. Re: Windows 7, provisioning and computer name
                            Apprentice

                            Yes, just copy it to a new text file and save as vbs.

                             

                            What I did was put that VBScript in the \\coreserver\ldmain\landesk\files directory and copy it to the machine during WinPE after the image is laid down.  Then the first action I have after the machine runs sysprep is to execute that script.  Then reboot, then proceed with whatever other actions you want.

                             

                            Let me know if that's enough info for you.  I don't mind elaborating further if need be!