bsharath
asked on
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
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
wow.
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.
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.
ASKER
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.
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.
One
"How to Install IIS Unattended"
http://www.iis-digest.com/?page_id=114
And Two
"Creating an Answer File"
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/efefcb53-b86e-4cac-9b4b-fcf5f1145aa9.mspx?mfr=true
zf
"How to Install IIS Unattended"
http://www.iis-digest.com/?page_id=114
And Two
"Creating an Answer File"
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/efefcb53-b86e-4cac-9b4b-fcf5f1145aa9.mspx?mfr=true
zf
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
"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
ASKER
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
-------------------------- -
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
--------------------------
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
zf
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
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
Just retested on an 03 server and worked just fine.
zf
zf
Also just tested on XP pro sp2 worked fine, has to be your path information is incorrect.
zf
zf
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\SOFTWA RE\Microso ft\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\i38 6files"
zf
this can be found at
[HKEY_LOCAL_MACHINE\SOFTWA
"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\i38
zf
ASKER
Any way to give the i386 path in the unattended file itself.As if would be easier
ASKER
I am using this.
Sysocmgr.exe /i: c:\windows\inf\sysoc.inf /u: c:\IIS_unattended.txt
Is it correct
Sysocmgr.exe /i: c:\windows\inf\sysoc.inf /u: c:\IIS_unattended.txt
Is it correct
ASKER
I am running this on a windows 2003 machine...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
One second, Ill get you a fix for that,
zf
zf
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
' ''''https://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.Fi leSystemOb ject")
Set objWshShell = WScript.CreateObject("WScr ipt.Shell" )
strCurPath = CreateObject("Scripting.Fi leSystemOb ject").Get AbsolutePa thName("." )
strSourcePath = InputBox("Please enter the full path to the I386" & VbCrLf & "folder on the server share" & VbCrLf & "\\server\03srv\i386","Cha nge 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(strPcLis t) 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,"Chang e Source Path."
WScript.Quit(0)
Else 'File exists continue
dte = Replace(FormatDateTime(dat e(),vbshor tdate),"/" ,"-")
tme = Replace(Replace(FormatDate Time(now() ,vbLongtim e),":","-" )," ","")
strResultsFile = strCurPath & "\" & tme & "_" & dte & ".csv"
If objFSO.FileExists(strResul tsFile) Then
ObjFSO.deleteFile(strResul tsFile)
Else
Set objOutputFile = objFso.CreateTextFile(strR esultsFile )
objOutputFile.Close
End If
MsgBox strResultsFile
Set objPCnames = objFso.GetFile(strPcList)
Set objReadFile = objPCnames.OpenAsTextStrea m(ForReadi ng, TristateUseDefault)
Do Until objReadFile.AtEndOfStream
ReDim Preserve arrPCnames(intLneCount)
arrPCnames(intLneCount) = objReadFile.ReadLine
intLneCount = intLneCount + 1
Loop
objReadFile.Close
Set objOutputFile = objFso.OpenTextFile(strRes ultsFile,F orWriting, TristateUs eDefault)
objOutputFile.WriteLine("C omputer,Re sponse")
For intPCLoop = LBound(arrPCnames) To UBound(arrPCnames)
strTestcon = IsServerOn(arrPCnames(intP CLoop))
If strTestcon = "0" Then
strReturn = setSource(arrPCnames(intPC Loop),strS ourcePath)
objOutputFile.WriteLine(ar rPCnames(i ntPCLoop) & "," & strReturn)
Else
objOutputFile.WriteLine(ar rPCnames(i ntPCLoop) & "," & 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("WScr ipt.Shell" )
Set objRemReg = GetObject("winmgmts://" & strcomputer & "/root/default:StdRegProv" )
'On Error Resume Next
RegLocate = "HKEY_LOCAL_MACHINE\SOFTWA RE\Microso ft\Windows NT\CurrentVersion\SourcePa th"
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.Fi leSystemOb ject")
Set objTxtLines = objFso.GetFile(strTxtFile)
Set objReadFile = objTxtLines.OpenAsTextStre am(ForRead ing, 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
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
' ''''https://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.Fi
Set objWshShell = WScript.CreateObject("WScr
strCurPath = CreateObject("Scripting.Fi
strSourcePath = InputBox("Please enter the full path to the I386" & VbCrLf & "folder on the server share" & VbCrLf & "\\server\03srv\i386","Cha
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(strPcLis
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,"Chang
WScript.Quit(0)
Else 'File exists continue
dte = Replace(FormatDateTime(dat
tme = Replace(Replace(FormatDate
strResultsFile = strCurPath & "\" & tme & "_" & dte & ".csv"
If objFSO.FileExists(strResul
ObjFSO.deleteFile(strResul
Else
Set objOutputFile = objFso.CreateTextFile(strR
objOutputFile.Close
End If
MsgBox strResultsFile
Set objPCnames = objFso.GetFile(strPcList)
Set objReadFile = objPCnames.OpenAsTextStrea
Do Until objReadFile.AtEndOfStream
ReDim Preserve arrPCnames(intLneCount)
arrPCnames(intLneCount) = objReadFile.ReadLine
intLneCount = intLneCount + 1
Loop
objReadFile.Close
Set objOutputFile = objFso.OpenTextFile(strRes
objOutputFile.WriteLine("C
For intPCLoop = LBound(arrPCnames) To UBound(arrPCnames)
strTestcon = IsServerOn(arrPCnames(intP
If strTestcon = "0" Then
strReturn = setSource(arrPCnames(intPC
objOutputFile.WriteLine(ar
Else
objOutputFile.WriteLine(ar
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("WScr
Set objRemReg = GetObject("winmgmts://" & strcomputer & "/root/default:StdRegProv"
'On Error Resume Next
RegLocate = "HKEY_LOCAL_MACHINE\SOFTWA
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.Fi
Set objTxtLines = objFso.GetFile(strTxtFile)
Set objReadFile = objTxtLines.OpenAsTextStre
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
ASKER
Excellent zoofan the script worked great and even the i386 path change script worked....