[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 597
  • Last Modified:

Need to install IIS on 100 machines

Hi,

I need to install IIS in 100 machines is there a easy way to do this remotely and unattended.Can i have the script for this please.

Regards
Sharath
0
bsharath
Asked:
bsharath
1 Solution
 
BrughCommented:
wow.

0
 
zephyr_hex (Megan)DeveloperCommented:
have you considered the security risk for doing this?  and the network traffic it will create?

maybe a little more detail on what you are trying to achieve by having IIS on 100 computers will help clarify things a bit more...  because in general, it sounds like something that is not good.
0
 
bsharathAuthor Commented:
zephyr_hex

I dont understand the security risk in this.All the 100 computers are useed by developers and they need to do there development for which they need IIS installed.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
zoofanCommented:
And then,

"MSI Installer for IIS"
http://www.topshareware.com/InstallAware-Express-for-Windows-Installer-download-39591.htm

create the MSI package for IIS and assign/publish the package via Group Policy Software to just the pc's that need it.

zf
0
 
bsharathAuthor Commented:
Zoofan
I tried this link.

http://www.iis-digest.com/?page_id=114

I get this error when i follow the steps.have you done this before if yes can you help...

---------------------------
Windows Setup
---------------------------
The application could not be initialized.
---------------------------
OK  
---------------------------
0
 
zoofanCommented:
Have run this on 2k pro machines to setup for a IIS lab yes, and did work corretly.  Check your unattend file and most importatly your command line for typo's

zf
0
 
zoofanCommented:
Sysocmgr.exe /i:%windir%\inf\sysoc.inf /u:%PathToUnattendFile%


replace  %windir%  with the path to your windows dir,  c:WINNT or c:\Windows

replace %PathToUnattendFile% with the path to your newly created unattendfile ex:  c:\iis\unattend.txt (where you put the txt file)


zf
0
 
zoofanCommented:
Just retested on an 03 server and worked just fine.

zf

0
 
zoofanCommented:
Also just tested on XP pro sp2 worked fine,  has to be your path information is incorrect.

zf
0
 
zoofanCommented:
Side note,  if the orginal source path for the install is unavailable it will ask for the cd.

this can be found at

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
"SourcePath"="D:\\I386"

if it was a cd based install you can create a share on a server and change this regkey to the share path
"SourcePath"="\\server\i386files"

zf
0
 
bsharathAuthor Commented:
Any way to give the i386 path in the unattended file itself.As if would be easier
0
 
bsharathAuthor Commented:
I am using this.

Sysocmgr.exe /i: c:\windows\inf\sysoc.inf /u: c:\IIS_unattended.txt

Is it correct
0
 
bsharathAuthor Commented:
I am running this on a windows 2003 machine...
0
 
zoofanCommented:
Sysocmgr.exe /i: c:\windows\inf\sysoc.inf /u: c:\IIS_unattended.txt

no space between /i:c:\ and no space between /u:c:\

There is no option in the unattend to specify install source path sadly!


zf
0
 
zoofanCommented:
One second, Ill get you a fix for that,

zf
0
 
zoofanCommented:
Create a pclist file,  list all pc's that need the change

pcname1
pcname2
pcname3

This will change the key for you on the remote's  be sure to enter the path to the I386 folder directly when prompted.

I have tested several times, please retest on single pc before implementing out.

your script!

'===Start copy: setsource.vbs===
' ---------------------------------------------------------------'
' setsource.vbs
' 'Sample VBScript to query remote computers
' 'and reset install source path
' ''Author Riley C. aka ZooFan
' '''Version 1.0 - August 2007
' ''''www.experts-exchange.com question ID:
' ---------------------------------------------------------------'
'
Option Explicit
Const ForReading = 1, ForWriting = 2, ForAppending = 3 'FileObject Access Type
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 'FileObject Format Type
Dim strPcList
Dim arrPcnames()
Dim strResultsFile
Dim dte
Dim tme
Dim objFso
Dim objWshShell
Dim objPCnames
Dim objReadFile
Dim intLneCount
Dim objOutputFile
Dim strCurPath
Dim intPCLoop
Dim strReturn      
Dim strTestcon
Dim strSourcePath
      Set objFso = CreateObject("Scripting.FileSystemObject")
      Set objWshShell = WScript.CreateObject("WScript.Shell")
      strCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
      strSourcePath = InputBox("Please enter the full path to the I386" & VbCrLf & "folder on the server share" & VbCrLf & "\\server\03srv\i386","Change Source Path.")
      If strSourcePath = "" Then
                  MsgBox "You must enter a path!",vbOKOnly,"Change Source Path."
                WScript.Quit(0)
      End if                
      strPcList = InputBox("Please enter the full path and file" & VbCrLf & "name of the file with the computer names.","Change Source Path.")
            'Test to make sure file exists if not exit script
            If Not objFso.FileExists(strPcList) Then
                  MsgBox "You must enter a valid full path and file name!",vbOKOnly,"Change Source Path."
                WScript.Quit(0)
            ElseIf strPcList = "" Then
                  MsgBox "You must enter a filename!",vbOKOnly,"Change Source Path."
                WScript.Quit(0)               
            Else 'File exists continue
                                    dte = Replace(FormatDateTime(date(),vbshortdate),"/","-")
                                    tme = Replace(Replace(FormatDateTime(now(),vbLongtime),":","-")," ","")
                                          strResultsFile = strCurPath & "\" & tme & "_" & dte & ".csv"
                                                If objFSO.FileExists(strResultsFile) Then
                                                      ObjFSO.deleteFile(strResultsFile)
                                                Else
                                                      Set objOutputFile = objFso.CreateTextFile(strResultsFile)
                                                      objOutputFile.Close      
                                                End If
                                                MsgBox strResultsFile
                                    Set objPCnames = objFso.GetFile(strPcList)
                                    Set objReadFile = objPCnames.OpenAsTextStream(ForReading, TristateUseDefault)
                                          Do Until objReadFile.AtEndOfStream
                                                ReDim Preserve arrPCnames(intLneCount)
                                                arrPCnames(intLneCount) = objReadFile.ReadLine
                                                intLneCount = intLneCount + 1
                                          Loop
                                    objReadFile.Close
                                          Set objOutputFile = objFso.OpenTextFile(strResultsFile,ForWriting,TristateUseDefault)
                                          objOutputFile.WriteLine("Computer,Response")
                                                For intPCLoop = LBound(arrPCnames) To UBound(arrPCnames)
                                                      strTestcon = IsServerOn(arrPCnames(intPCLoop))
                                                      If strTestcon = "0" Then                                                
                                                      strReturn = setSource(arrPCnames(intPCLoop),strSourcePath)
                                                      objOutputFile.WriteLine(arrPCnames(intPCLoop) & "," & strReturn)
                                                      Else
                                                      objOutputFile.WriteLine(arrPCnames(intPCLoop) & "," & strTestcon)
                                                      End If
                                                Next
                                           objOutputFile.Close
                                           MsgBox("Script has completed")
                                    WScript.Quit
                        End If
Function setSource(strcomputer, strSource)
Dim objSetShell, RegLocate
Dim objRemReg
Set objSetShell = WScript.CreateObject("WScript.Shell")
Set objRemReg = GetObject("winmgmts://" & strcomputer & "/root/default:StdRegProv")
'On Error Resume Next
RegLocate = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SourcePath"
      objSetShell.RegWrite RegLocate, strSource, "REG_SZ"
setSource = "Source Path Changed"
Set objSetShell = Nothing
Set objRemReg = Nothing      
End Function

Function IsServerOn(strserver)                        
      Dim Testme
      Dim intErr
      Dim strRegValue
      Dim strFileServer
      On Error Resume Next
            Set Testme = GetObject("winmgmts://" & strserver & "/root/cimv2")
                  Set strRegValue = GetObject("winmgmts://" & strserver & "/root/default:StdRegProv")
                        intErr = Err.Number
                        If intErr <> 0 Then
                              IsServerOn = Err.Description
                        Else
                              IsServerOn = "0"
                        End If
      On Error GoTo 0
End Function
Function readtextfile(strTxtFile, arrname())
On Error Resume Next
      Dim intErr, intLines
      Dim objTxtLines, objReadFile,objFso      
            Set objFso = CreateObject("Scripting.FileSystemObject")
            Set objTxtLines = objFso.GetFile(strTxtFile)
            Set objReadFile = objTxtLines.OpenAsTextStream(ForReading, TristateUseDefault)
                  Do Until objReadFile.AtEndOfStream
                        ReDim Preserve arrname(intLines)
                        arrname(intLines) = objReadFile.ReadLine
                        intLines = intLines + 1
                  Loop
            objReadFile.Close
            Set objFso = nothing
            Set objTxtLines = Nothing
            Set objReadFile = Nothing
                  intErr = Hex(Err.Number)
                        If intErr <> 0 Then
                              readtextfile = Err.Description
                        Else
                              readtextfile = "0"
                        End If
On Error GoTo 0                        
End Function
'===End copy: setsource.vbs===


any problems let me know,


zf
0
 
bsharathAuthor Commented:
Excellent zoofan the script worked great and even the i386 path change script worked....
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now