Link to home
Create AccountLog in
Avatar of ActiveInfoSys
ActiveInfoSysFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Windows Server 2003 R2 Components and Unattended + SysPrep Installations

Hello Experts -

Attempting to integrate R2 components into Unattended Installl.    Can I get general opinions, commentary here and especially addressing correct networks path systaxing below for [GUIRunOnce] registry entries.

To complete the procedure I have done the following:

1st Step:  Distribution Share Folder Addition
I have put the \Cmpnents folder at the same level as my platform (i386) Directory.  This is to avoid the dialog box will appear during Windows Server 2003 R2 Setup, prompting for the location of the Setup2.exe file.
2nd Step: Answer File
I have updated the answer file:   S10300untd.txt with this new addition at the end of the file:
[GUIRunOnce]
"cmd /c \\EAHAHMGT01.ah.avisrac.net\svrimage /user:eahahmgt01\afasdasdf adjfklsdjf
"cmd /c \\EAHAHMGT01.ah.avisrac.net\svrimage\W2k3\STANDARD_10300\CMPNENTS\R2\SETUP2.EXE /q /a"
 OR SHOULD THIS BE:  cmd /c net use \\eahahmgt01..............

If we stop at this point, looks like the following happens:  http://www.mail-archive.com/unattended-info@lists.sourceforge.net/msg06618.html .  

So Third Step, possibly, but dont see why necessary really

3rd Step:  SourcePath Reg Key
To address the Prompt Problem  One of the issues that end users will be prompted to insert the W2K3 R2 Disc 2 when using the Windows Components Wizard to install W2K3 R2 components.

Since our Answer File has the entry:  OEMPreInstall=Yes entry, and thus specifying that setup should copy the subfolders and files contained in the $oem$ folder, our Source Path registry key is auto reset to the servers CD-ROM drive after Setup completes BUT before[GUIRunOnce] is executed.  SO....

We have two options:  A and B.  
A.      Sysprep Factory Mode.  
To set Source Path registry key to location of i386 and \Cmpnents folders modify SourcePath entry in Winbom.ini
Or
B.      Answer File
To set Source Path registry key to location of i386 and \Cmpnents folders modify SourcePath entry at the [GUIRunOnce] section.
[GUIRunOnce]
"cmd /c reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Setup /v SourcePath /t REG_SZ /d source_path /f"
"cmd /c reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Setup /v ServicePackSourcePath /t REG_SZ /d source_path /f"
[GUIRunOnce]
"cmd /c reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Setup /v SourcePath /t REG_SZ /d source_path /f"
"cmd /c reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Setup /v ServicePackSourcePath /t REG_SZ /d source_path /f"

But why?  From Microsoft Docs, the above steps are important because Sysprep resets the SourcePath reg key to the servers CD-ROM during Mini-Step if the path in accessible or invalid during Mini-Setup. This happens in most instances where a UNC network share is set for the SourcePath reg key.  Thus, to avoid resetting the SourcePath reg key, use the ResetSourcePath entry in Sysprep.inf before launching SysPrep.  But this is yet to be achieved? Or understood....

Any ideas and help much appreciated.


Avatar of Netman66
Netman66
Flag of Canada image

You could try:

GUIRunOnce]
"cmd /c net use X: \\EAHAHMGT01.ah.avisrac.net\svrimage
"cmd /c  X:\W2k3\STANDARD_10300\CMPNENTS\R2\SETUP2.EXE /q /a"

As long as the Share is Authenticated Users - Full and the NTFS permissions are Authenticated Users - Read and Execute then it should work.


Avatar of ActiveInfoSys

ASKER

Awesome, yes it does work but then setup stops, just pauses after some post-config wmi,vbscripting I've setup...

Can I post the scripts and get your feedback Netman66....

Nothing major, just small scripts...
Sure.  If there's anything special about them then inform us with some comments.

I think I'm about to fix it...hang on until morning..OK
This is the code not working netman66.... the previous code does OK for all models of DELL, 1750, 1850, 1950, but these 1955 are not playing ball....


      ' Set drive letters for DELL POWEREDGE 1955 BLADES     (might be different if using Virtual Media via DRAC in use)
      Sub PEx955
            Set colVolumes = objWMIService.ExecQuery("Select * from Win32_Volume")
            For Each objVolume in colVolumes
                  strVol = objVolume.DriveLetter
                        IF strVol = "D:" THEN
                              objVolume.DriveLetter = "M:"
                                  objVolume.Put_      
                                  UpdateProgress("   1955vFloppy changed to M:")
                        ELSEIF strVol = "E:" THEN
                              objVolume.DriveLetter = "V:"
                                  objVolume.Put_
                                  UpdateProgress("   Software changed to V:")      
                        ELSEIF strVol = "F:" THEN
                              objVolume.DriveLetter = "W:"
                                  objVolume.Put_      
                                  UpdateProgress("   CD changed to W:")
                        ELSEIF strVol = "G:" THEN
                              objVolume.DriveLetter = "N:"
                                  objVolume.Put_
                                  UpdateProgress("   1955vCD changed to N:")      
                        END IF
            Next
      
            
<?xml version="1.0"?>
<package>
<job id="Server_Build03">

<!--
runstart.wsf
 Windows Server 2003 Post Textmode Install Configuration Script

'Date            Name                  Description
-------------------------------------------------------------------------
'04/06/2007            J Miles                                 Update for DELL PowerEdge x955 series

To Do:


-->

<!-- Include Files -->
<script language="vbscript" src="c:\winnt\preprep\scripts\Prog_win.vbs"/>
<script language="vbscript" src="c:\winnt\preprep\scripts\copyfiles.vbs"/>
<script language="vbscript" src="c:\winnt\preprep\scripts\hotfixes.vbs"/>
<script language="vbscript" src="c:\winnt\preprep\scripts\coreapps.vbs"/>


<!-- Below is the Main Script -->

<script language="vbscript">

<![CDATA[


' Set variables

      Option Explicit
      
      Dim scriptname, jobID, patchno, insNum, prog, subKey, arrSubKeys, vidkey
      Dim strVersion, strRegion, strComputer, strModel, strVol, strInstPath, strSysRoot, strOS, strScriptPath, strCompName, strHotfix, strKeyPath
      Dim wshHandle, wshSysEnv
      Dim objUser, objGroup, objUserFlags, objService, objNewJob, objVolume, objNetwork, objWMIService, objSysRoot, objItem, objReg
      Dim colAccounts, colVolumes, colItems
      
      strComputer = "."
      scriptname = "AvisRunStartScript"
      
' Set Environment

      Set wshHandle = WScript.CreateObject("WScript.Shell")
      Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
      Set fsoHandle = WScript.CreateObject("Scripting.FileSystemObject")
      Set objNetwork = CreateObject("WScript.Network")
      Set wshSysEnv = wshHandle.Environment("Process")
      Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")      
      
      const HKLM = &H80000002

      strSysRoot = wshSysEnv("SYSTEMROOT")      
      strScriptPath = strSysRoot & "\preprep\scripts"
      strInstPath = strSysRoot & "\MASTERS"
      strModel = "unknown"      
      strCompName = objNetwork.ComputerName
      strHotfix = strInstPath & "\hotfixes\"
      strKeyPath = "System\CurrentControlSet\Control\Video"
      patchno = 0
      insNum = 1
      prog = 1
      

' Define Server Hardware to variable

      SET colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL")      

                     For Each objItem In colItems
                                 strModel = objItem.Model
                    Next                                    

' Identify OS

      SET colItems = objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL")      
            For Each objItem In colItems
                  strOS = objItem.Caption
            Next
                              

' Open Progress Window

      OpenProgressWindow
      UpdateProgress(prog & ".  " & "Starting post setup process")
      prog = prog + 1


' Enumerate Basic Info

      UpdateProgress(prog & ".  " & "Model: " & strModel)
      prog = prog + 1
      UpdateProgress(prog & ".  " & "Operating System: " & strOS)            
      prog = prog + 1
      

' Map network drive
            
      UpdateProgress(prog & ".  " & "Mapping Network Drive")      
      prog = prog + 1
      objNetwork.MapNetworkDrive "Z:", "\\EIXIXBKP02.ix.avisrac.net\svrimage", False,             

' Set startup timeout in boot.ini

      UpdateProgress(prog & ".  " & "Configure boot.ini")      
      prog = prog + 1
      wshHandle.Run "cmd.exe /c ATTRIB -R -S -H C:\boot.ini", 0, True
      wshHandle.Run "rundll32 setupapi,InstallHinfSection DefaultInstall 128 " & strScriptPath & "\boot.inf", 0, True
      wshHandle.Run "cmd.exe /c ATTRIB +R +S +H C:\boot.ini", 0, True
      
' Set drive letters

      UpdateProgress(prog & ".  " & "Setting Drive Letters")
      prog = prog + 1
      
      ' Determine Server Model Type
            SELECT CASE Trim(strModel)
                   CASE "VMware Virtual Platform"
                                     vmdrive
                   CASE "PowerEdge 1750"
                                     PEx650x750            
                   CASE "PowerEdge 1850"
                                     PEx850x950
                   CASE "PowerEdge 1950"
                                     PEx850x950
                   CASE "PowerEdge 1955"
                                     PEx955
                   CASE "PowerEdge 2850"
                                     PEx850x950
                   CASE "PowerEdge 2950"
                                     PEx850x950
                   CASE "PowerEdge 6650"
                                     PEx650x750
                   CASE "PowerEdge 6850"
                                     PEx850x950
                   CASE "PowerEdge 6950"
                                     PEx850x950
                   CASE ELSE
                                     NoID                         
            END Select


      ' No suitable hardware found
      Sub NoID
      
      End Sub

      ' Set drive letters for vmware guest
      Sub vmdrive
            Set colVolumes = objWMIService.ExecQuery("Select * from Win32_Volume")
            For Each objVolume in colVolumes
                  strVol = objVolume.DriveLetter
                        IF strVol = "D:" THEN
                              objVolume.DriveLetter = "W:"
                                  objVolume.Put_      
                                  UpdateProgress("   CD changed to W:")
                        END If
            Next
      
            
      End Sub

      ' Set drive letters for legacy hardware
      Sub PEx650x750
            Set colVolumes = objWMIService.ExecQuery("Select * from Win32_Volume")
            For Each objVolume in colVolumes
                  strVol = objVolume.DriveLetter
                        IF strVol = "D:" THEN
                              objVolume.DriveLetter = "V:"
                                  objVolume.Put_      
                                  UpdateProgress("   Software changed to V:")
                        ELSEIF strVol = "E:" THEN
                              objVolume.DriveLetter = "W:"
                                  objVolume.Put_      
                                  UpdateProgress("   CD changed to W:")
                        END IF
            Next
            
      
      End Sub       

      ' Set drive letters for current and new generation hardware
      Sub PEx850x950
            Set colVolumes = objWMIService.ExecQuery("Select * from Win32_Volume")
            For Each objVolume in colVolumes
                  strVol = objVolume.DriveLetter
                        IF strVol = "D:" THEN
                              objVolume.DriveLetter = "M:"
                                  objVolume.Put_      
                                  UpdateProgress("   vFloppy changed to M:")
                        ELSEIF strVol = "E:" THEN
                              objVolume.DriveLetter = "V:"
                                  objVolume.Put_
                                  UpdateProgress("   Software changed to V:")      
                        ELSEIF strVol = "F:" THEN
                              objVolume.DriveLetter = "W:"
                                  objVolume.Put_      
                                  UpdateProgress("   CD changed to W:")
                        ELSEIF strVol = "G:" THEN
                              objVolume.DriveLetter = "N:"
                                  objVolume.Put_
                                  UpdateProgress("   vCD changed to N:")      
                        END IF
            Next
      
            
      End Sub
To Do:


-->

<!-- Include Files -->


**what does the To Do:  do above?
I haven't parsed all the scripts yet, however one thing comes to mind here.

These Blades must be setup with LUNs on the SAN so I can see some of the local stuff to the server working but not anything that needs to be configured through the HBA.

Are these scripts running after the HBA and LUN are configured?

I'm trying to figure out what and when these scripts are used (for)?

Perhaps a short walkthrough of how your staging these servers would help figure out where the process fails.  Keep in mind, Blade servers are a whole different beast than normal servers and the Win32_Volume subset may not contain the same information without specifically adding the MIB info into WBEM.

Wow..thanks Netmann66.. well stated above in terms of context and process.

OK

Scripts run as a post-setup config routine after an unattended installation, so using the cmdlines.txt " root of $oem$...
[Commands]
"C:\WINNT\PREPREP\SCRIPTS\textmode.cmd"

Then textmode.cmd looks like the following:
Rem -- Set variables
Set INSTALL=C:\WINNT\PREPREP\SCRIPTS


Rem -- Inject Registry changes
cmd /c %SystemRoot%\REGEDIT.EXE /S %INSTALL%\textmode.reg

Rem -- Set the Windows Script Host Defaults
cmd /c %systemroot%\system32\cscript //H:cscript //NoLogo //S


And inside textmode.cmd the following is executed in a line or two:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"runstart"="cmd /c %SystemRoot%\\PREPREP\\SCRIPTS\\runstart.wsf
And this brings us to runstart.wsf...

The  post configuration after a unattended install...
Posted here.

<?xml version="1.0"?>
<package>
<job id="Server_Build03">

<!--
runstart.wsf
Windows Server 2003 Post Textmode Install Configuration Script

'Date            Name                  Description
--------------------------------------------------------------------
'04/06/2007            J Miles                                 Update for DELL PowerEdge x955 series

To Do:


-->

<!-- Include Files -->
<script language="vbscript" src="c:\winnt\preprep\scripts\Prog_win.vbs"/>
<script language="vbscript" src="c:\winnt\preprep\scripts\copyfiles.vbs"/>
<script language="vbscript" src="c:\winnt\preprep\scripts\hotfixes.vbs"/>
<script language="vbscript" src="c:\winnt\preprep\scripts\coreapps.vbs"/>


<!-- Below is the Main Script -->

<script language="vbscript">

<![CDATA[


' Set variables

      Option Explicit
      
      Dim scriptname, jobID, patchno, insNum, prog, subKey, arrSubKeys, vidkey
      Dim strVersion, strRegion, strComputer, strModel, strVol, strInstPath, strSysRoot, strOS, strScriptPath, strCompName, strHotfix, strKeyPath
      Dim wshHandle, wshSysEnv
      Dim objUser, objGroup, objUserFlags, objService, objNewJob, objVolume, objNetwork, objWMIService, objSysRoot, objItem, objReg
      Dim colAccounts, colVolumes, colItems
      
      strComputer = "."
      scriptname = "AvisRunStartScript"
      
' Set Environment

      Set wshHandle = WScript.CreateObject("WScript.Shell")
      Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
      Set fsoHandle = WScript.CreateObject("Scripting.FileSystemObject")
      Set objNetwork = CreateObject("WScript.Network")
      Set wshSysEnv = wshHandle.Environment("Process")
      Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")      
      
      const HKLM = &H80000002

      strSysRoot = wshSysEnv("SYSTEMROOT")      
      strScriptPath = strSysRoot & "\preprep\scripts"
      strInstPath = strSysRoot & "\MASTERS"
      strModel = "unknown"      
      strCompName = objNetwork.ComputerName
      strHotfix = strInstPath & "\hotfixes\"
      strKeyPath = "System\CurrentControlSet\Control\Video"
      patchno = 0
      insNum = 1
      prog = 1
      

' Define Server Hardware to variable

      SET colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL")      

                     For Each objItem In colItems
                                 strModel = objItem.Model
                    Next                                    

' Identify OS

      SET colItems = objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL")      
            For Each objItem In colItems
                  strOS = objItem.Caption
            Next
                              

' Open Progress Window

      OpenProgressWindow
      UpdateProgress(prog & ".  " & "Starting post setup process")
      prog = prog + 1


' Enumerate Basic Info

      UpdateProgress(prog & ".  " & "Model: " & strModel)
      prog = prog + 1
      UpdateProgress(prog & ".  " & "Operating System: " & strOS)            
      prog = prog + 1
      

' Map network drive
            
      UpdateProgress(prog & ".  " & "Mapping Network Drive")      
      prog = prog + 1
      objNetwork.MapNetworkDrive "Z:", "\\EIXIXBKP02.ix.avisrac.net\svrimage", False,             

' Set startup timeout in boot.ini

      UpdateProgress(prog & ".  " & "Configure boot.ini")      
      prog = prog + 1
      wshHandle.Run "cmd.exe /c ATTRIB -R -S -H C:\boot.ini", 0, True
      wshHandle.Run "rundll32 setupapi,InstallHinfSection DefaultInstall 128 " & strScriptPath & "\boot.inf", 0, True
      wshHandle.Run "cmd.exe /c ATTRIB +R +S +H C:\boot.ini", 0, True
      
' Set drive letters

      UpdateProgress(prog & ".  " & "Setting Drive Letters")
      prog = prog + 1
      
      ' Determine Server Model Type
            SELECT CASE Trim(strModel)
                   CASE "VMware Virtual Platform"
                                     vmdrive
                   CASE "PowerEdge 1750"
                                     PEx650x750            
                   CASE "PowerEdge 1850"
                                     PEx850x950
                   CASE "PowerEdge 1950"
                                     PEx850x950
                   CASE "PowerEdge 1955"
                                     PEx955
                   CASE "PowerEdge 2850"
                                     PEx850x950
                   CASE "PowerEdge 2950"
                                     PEx850x950
                   CASE "PowerEdge 6650"
                                     PEx650x750
                   CASE "PowerEdge 6850"
                                     PEx850x950
                   CASE "PowerEdge 6950"
                                     PEx850x950
                   CASE ELSE
                                     NoID                         
            END Select


      ' No suitable hardware found
      Sub NoID
      
      End Sub

      ' Set drive letters for vmware guest
      Sub vmdrive
            Set colVolumes = objWMIService.ExecQuery("Select * from Win32_Volume")
            For Each objVolume in colVolumes
                  strVol = objVolume.DriveLetter
                        IF strVol = "D:" THEN
                              objVolume.DriveLetter = "W:"
                                  objVolume.Put_      
                                  UpdateProgress("   CD changed to W:")
                        END If
            Next
      
            
      End Sub

      ' Set drive letters for legacy hardware
      Sub PEx650x750
            Set colVolumes = objWMIService.ExecQuery("Select * from Win32_Volume")
            For Each objVolume in colVolumes
                  strVol = objVolume.DriveLetter
                        IF strVol = "D:" THEN
                              objVolume.DriveLetter = "V:"
                                  objVolume.Put_      
                                  UpdateProgress("   Software changed to V:")
                        ELSEIF strVol = "E:" THEN
                              objVolume.DriveLetter = "W:"
                                  objVolume.Put_      
                                  UpdateProgress("   CD changed to W:")
                        END IF
            Next
            
      
      End Sub       

      ' Set drive letters for current and new generation hardware
      Sub PEx850x950
            Set colVolumes = objWMIService.ExecQuery("Select * from Win32_Volume")
            For Each objVolume in colVolumes
                  strVol = objVolume.DriveLetter
                        IF strVol = "D:" THEN
                              objVolume.DriveLetter = "M:"
                                  objVolume.Put_      
                                  UpdateProgress("   vFloppy changed to M:")
                        ELSEIF strVol = "E:" THEN
                              objVolume.DriveLetter = "V:"
                                  objVolume.Put_
                                  UpdateProgress("   Software changed to V:")      
                        ELSEIF strVol = "F:" THEN
                              objVolume.DriveLetter = "W:"
                                  objVolume.Put_      
                                  UpdateProgress("   CD changed to W:")
                        ELSEIF strVol = "G:" THEN
                              objVolume.DriveLetter = "N:"
                                  objVolume.Put_
                                  UpdateProgress("   vCD changed to N:")      
                        END IF
            Next
      
            
      End Sub
      
      ' Set drive letters for DELL POWEREDGE 1955 BLADES     (NOTE: Blades do not have CD-ROM and DRAC as New Gen)
      Sub PEx955
            Set colVolumes = objWMIService.ExecQuery("Select * from Win32_Volume")
            For Each objVolume in colVolumes
                  strVol = objVolume.DriveLetter
                        IF strVol = "D:" THEN
                              objVolume.DriveLetter = "M:"
                                  objVolume.Put_      
                                  UpdateProgress("   1955vFloppy changed to M:")
                        ELSEIF strVol = "E:" THEN
                              objVolume.DriveLetter = "V:"
                                  objVolume.Put_
                                  UpdateProgress("   Software changed to V:")      
                        ELSEIF strVol = "F:" THEN
                              objVolume.DriveLetter = "N:"
                                  objVolume.Put_
                                  UpdateProgress("   1955vCD changed to N:")      
                        END IF
            Next
      
            
      End Sub



' Set Server 2003 media source path

      UpdateProgress(prog & ".  " & "Updating W2k3 Source Path")
      prog = prog + 1

      If strModel = "VMware Virtual Platform" Then
            wshHandle.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SourcePath", "C:\\W2k3.SRV\\Standard\\", "REG_SZ"
            wshHandle.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\ServicePackSourcePath", "C:\\W2k3.SRV\\Standard\\", "REG_SZ"             
            UpdateProgress("   W2k3 source path changed to C:")
      Else
            wshHandle.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SourcePath", "V:\\W2k3.SRV\\Standard\\", "REG_SZ"
            wshHandle.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\ServicePackSourcePath", "V:\\W2k3.SRV\\Standard\\", "REG_SZ"
            UpdateProgress("   W2k3 source path changed to V:")
      End If


' Set Windows Time and Video Configuration if VM Guest

      If strModel = "VMware Virtual Platform" Then
            UpdateProgress(prog & ".  " & "Configure VM Guest Time and Video")
            prog = prog + 1
            wshHandle.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\Type", "NoSync" 'check type      
            wshHandle.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\DisableAutoDaylightTimeSet", "1", "REG_DWORD"
      
            objreg.EnumKey HKLM, strKeyPath, arrSubKeys
                  For Each subKey in arrSubKeys
                        If subkey = "{23A77BF7-ED96-40EC-AF06-9B1F4867732A}" Or subkey = "{8B6D7859-A639-4A15-8790-7161976D057A}" Or subkey = "{DEB039CC-B704-4F53-B43E-9DD4432FA2E9}" Then
                              subKey = Null
                        Else
                              vidkey = subkey       
                        End if
                  Next
            wshHandle.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video\" & vidkey & "\0000\Acceleration.Level", "00000000", "REG_DWORD"
            wshHandle.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Video\" & vidkey & "\0000\Acceleration.Level", "00000000", "REG_DWORD"
      End If


' Delete unwanted Start menu and Desktop items

      UpdateProgress(prog & ".  " & "Processing Start Menu items")
      prog = prog + 1

      wshHandle.RegWrite "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{44BBA840-CC51-11CF-AAFA-00AA00B6015C}\StubPath", ""
      wshHandle.RegWrite "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{7790769C-0471-11d2-AF11-00C04FA35D02}\StubPath", ""
      wshHandle.RegDelete("HKEY_CURRENT_USER\Keyboard Layout\Preload\2")
      wshHandle.RegDelete("HKEY_USERS\.DEFAULT\Keyboard Layout\Preload\2")
      fsoHandle.DeleteFile "C:\Documents and Settings\All Users\start menu\Windows Catalog.lnk"
      fsoHandle.DeleteFile "C:\Documents and Settings\All Users\start menu\Windows Update.lnk"
      fsoHandle.DeleteFile "C:\Documents and Settings\All Users\Desktop\Security Configuration Wizard.lnk"      
      fsoHandle.DeleteFile "C:\Documents and Settings\Default User\Start Menu\Programs\Remote Assistance.lnk"
      fsoHandle.DeleteFile "C:\Documents and Settings\Administrator\Start Menu\Programs\Remote Assistance.lnk"
      

' Delete Support User account
      
      UpdateProgress(prog & ".  " & "Delete Support user account")
      prog = prog + 1
      
      Set colAccounts = GetObject("WinNT://" & strComputer & "")      
      colAccounts.Delete "user", "SUPPORT_388945a0"
      
      
' Add standby Admin account      

      UpdateProgress(prog & ".  " & "Create standby local Admin user account")
      prog = prog + 1

      ' Create user
            Set colAccounts = GetObject("WinNT://" & strComputer & "")
            Set objUser = colAccounts.Create("user","sysman")
            objUser.SetPassword "Bx23G73XV0"
            objUser.SetInfo

      ' Set no password expiry
            Set objUser = GetObject("WinNT://" & strComputer & "/sysman,user")
            objUserFlags = &H10000
            objUser.Put "UserFlags", objUserFlags
            objUser.SetInfo

      ' Add user to Local Admins group      
            Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
            Set objUser = GetObject("WinNT://" & strCompName & "/sysman,user")
            objGroup.Add (objUser.ADsPath)


' Configure DNS search suffixes

      UpdateProgress(prog & ".  " & "Configure DNS search suffixes")
      prog = prog + 1

      wshHandle.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\SearchList", "avisrac.net,ix.avisrac.net,ah.avisrac.net", "REG_SZ"


' Install Hotfixes

      Call Hotfixes
      

' Install Core Apps

      Call CoreApps


' Copy i386 folder
      
      scriptname = "AvisRunStartScript"
      
      Call Copyi386


' Copy Common Software to PowerEdge servers

      If strModel <> "VMware Virtual Platform" Then
            CopyMediaSource
      End If
      

' Set initial Local Security Policy

      UpdateProgress(prog & ".  " & "Configure temporary Local Security Policy")
      prog = prog + 1
      
      wshHandle.Run "cmd.exe /c secedit /configure /db secedit.sdb /cfg " & strScriptPath & "\preprep.inf", 0, True


' Configure scheduled Defrag task

      UpdateProgress(prog & ".  " & "Configure defrag scheduled task")
      prog = prog + 1

      Set objService = GetObject("winmgmts:\\" & strComputer & "")
      Set objNewJob = objService.Get("Win32_ScheduledJob")
      objNewJob.Create "Defrag C:", "********030000.000000-000", True , 1 OR 2 OR 4 OR 8 OR 16 OR 32 OR 64, , , JobID


' Defrag C:

      UpdateProgress(prog & ".  " & "Defragmenting C: Drive")      
      prog = prog + 1
      wshHandle.Run "C:\winnt\system32\defrag.exe c: -f", 0, True
      
      
' End script and reboot

      UpdateProgress("Preparing to reboot")
      
      WScript.Sleep 3000
      
      CloseProgressWindow
      
      WScript.Sleep 6000
      
      wshHandle.Run "c:\winnt\system32\shutdown.exe -R -T 10 -c ""Rebooting to set final build configuration""", 0, true
      

]]>
</script>
</job>
</package>
Netman66 said Are these scripts running after the HBA and LUN are configured?
**Scripts are running before HBA fiber cards are attached to SAN Switches..this a deployment process combining WinPE, Unattended Installs, Sysprep, and Ghost...wmi vb script is running pre- and post every phase above.

I'm trying to figure out what and when these scripts are used (for)?
**Windows Server 2003 R2 SP2 deployment farm for 150 Citrix Servers

Perhaps a short walkthrough of how your staging these servers would help figure out where the process fails.
**Server are new, shipped from DELL out of the box, no OS

Keep in mind, Blade servers are a whole different beast than normal servers and the Win32_Volume subset may not contain the same information without specifically adding the MIB info into WBEM.
**Where can I find info on the Win32_volume subset for my blades?

Thank you so much netman66
Ok, let's look at this logically.

Blades depend on their enclosure for the following:
Power
Network
SAN fabric
iLO aggregation

So, keeping that in mind, the bay needs to be connected to the network and SAN so the blade has the proper access.  Since the OS needs to be installed before you can connect to the SAN (since the LUN needs to be presented to a specific HBA) then anything that maps outside the local drives won't yet be available to your scripts.

I believe there should be a CD or two that comes with the blade itself that contains MIBs for any network management software to use.  Their industry standard files.  

I would stand one blade up and manually configure everything then query Win32_Volume to see what is available and even if your scripts are looking for the right info for these things.  You can either use a script (since someone there knows how to write them quite well) or in System32\wbem there is a utility called wbemtest.exe that you can use to look into all WMI class info.
NetMan6 - all is OK now with scripts. Thank you for you help.

I have one more related question:

Issue now is with the HBA QME2462  (2342M drivers) DELL drivers and boot time&..after adding updated drivers and general trouble-shooting I am getting a very long delay, possibly 30 minutes until server comes back up&.particular file which /sos boot.ini show as halting is:  acpitabl.dat but not sure if this is a red herring or not.

The server just hangs on the Windows Logo screen or if I use boot.ini /sos /noguiboot switches...shows the acpitabl.dat file just hanging...something to do with Power Management maybe, but NOTE:  this only happens after sysprep and ghosting. before all is OK and the server zips through the boot process...just after sysprep and Ghosting that problem occurs...almost as if there is an issue with what sysprep or ghost is doing to the drivers, etc... for the HBA card...

If I remove the HBA card, server boots OK.  To fix this, I have to uninstall the HBA drivers from Device Manager and then boot twice and then re-install drivers...odd...any thoughts?
ASKER CERTIFIED SOLUTION
Avatar of Netman66
Netman66
Flag of Canada image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Just did a re-unatted, re-syspep and re-ghost after putting through the updated drivers from here....plus hotfixes for HBA QLOGIC Fibre Cards.

http://support.qlogic.com/support/oem_product_detail.asp?p_id=988&oemid=65&oemname=Dell

 Seems the home dell site points to wrong device and that this new driver is key for my HBA cards...the dell site gives w2k only driver anyway....not the updated driver from 04/06/2007 yet....

By the way, not booting from SAN unfortunately, maybe next project.

Thanks NetMan66...you sure know alot man...Awesome to have you and others like you in this community to teach us newbiees.
There's a new driver as of June 6, 2007.

You did mention a hotfix too, as there is a storport driver issue that MS has fixed.

Driver must be the right one...thanks NetMan66...