Const OverwriteExisting = True set objShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") windowsdir = objshell.ExpandEnvironmentStrings("%windir%") 'Check to see if the msxml6.dll file exist. If it doesn't, msxml is probably not installed strFile = windowsdir & "\system32\msxml6.dll" 'Get the OS Version. This will be used to download the correct version and for writing the registry value OsType = objShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE") If objFSO.FileExists(strFile) Then 'Copy the install file to the local machines C: based on the version of the OS. If OsType = "x86" Then objFSO.CopyFile "\\media.hkg1.rackspace.com\SoftwareImages\Microsoft Applications\Microsoft SCOM\Agents\i386\MOMAgent.msi", "C:\MomAgent386.msi", OverwriteExisting Else objFSO.CopyFile "\\media.hkg1.rackspace.com\SoftwareImages\Microsoft Applications\Microsoft SCOM\Agents\AMD64\MOMAgent.msi", "C:\MomAgentAMD64.msi", OverwriteExisting End If 'We now have the file so perform the install and write the ManualInstall value to the registry If OsType = "x86" Then Set objScriptExec = objShell.Exec("MSIEXEC.exe /i c:\MOMAgent386.msi /qn USE_SETTINGS_FROM_AD=0 MANAGEMENT_GROUP=dfwManagementgroup MANAGEMENT_SERVER_DNS= 177424-omgw01.hkg.intensive.int") Wscript.Sleep 150000 'Write thi manual install value if 32 bit objshell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Rackspace\SCOMInstall",1 Else Set objScriptExec = objShell.Exec("MSIEXEC.exe /i c:\MOMAgentAMD64.msi /qn USE_SETTINGS_FROM_AD=0 MANAGEMENT_GROUP=dfwManagementgroup MANAGEMENT_SERVER_DNS= 177424-omgw01.hkg.intensive.int") Wscript.Sleep 150000 'Write this manual install value if 64 bit objshell.Regwrite "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Rackspace\SCOMInstall",1 End If Else 'xml 6 is not installed so download and install it first 'Copy the install file to the local machines C: based on the version of the OS. If OsType = "x86" Then objFSO.CopyFile "\\media.hkg1.rackspace.com\SoftwareImages\Microsoft Applications\Microsoft SCOM\mscml6xp1\msxml6_x86.msi", "C:\msxml6_x86.msi", OverwriteExisting Else objFSO.CopyFile "\\media.hkg1.rackspace.com\SoftwareImages\Microsoft Applications\Microsoft SCOM\mscml6xp1\msxml6_x64.msi", "C:\msxml6_x64.msi", OverwriteExisting End If 'The install files have been downloaded so run the installation in quiet mode If OsType = "x86" Then Set objScriptExec = objShell.Exec("MSIEXEC.exe /i C:\msxml6_x86.msi /quiet") Wscript.Sleep 150000 Else Set objScriptExec = objShell.Exec("MSIEXEC.exe /i C:\msxml6_x64.msi /quiet") Wscript.Sleep 150000 End If 'MSXML 6 should now be installed so download the SCOM Agent install files. If OsType = "x86" Then objFSO.CopyFile "\\media.hkg1.rackspace.com\SoftwareImages\Microsoft Applications\Microsoft SCOM\Agents\i386\MOMAgent.msi", "C:\MomAgent386.msi", OverwriteExisting Else objFSO.CopyFile "\\media.hkg1.rackspace.com\SoftwareImages\Microsoft Applications\Microsoft SCOM\Agents\AMD64\MOMAgent.msi", "C:\MomAgentAMD64.msi", OverwriteExisting End If 'We now have the file so perform the install and write the ManualInstall value to the registry If OsType = "x86" Then Set objScriptExec = objShell.Exec("MSIEXEC.exe /i c:\MOMAgent386.msi /qn USE_SETTINGS_FROM_AD=0 MANAGEMENT_GROUP=dfwManagementgroup MANAGEMENT_SERVER_DNS= 177424-omgw01.hkg.intensive.int") Wscript.Sleep 150000 'Write thi manual install value if 32 bit objshell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Rackspace\SCOMInstall",1 Else Set objScriptExec = objShell.Exec("MSIEXEC.exe /i c:\MOMAgentAMD64.msi /qn USE_SETTINGS_FROM_AD=0 MANAGEMENT_GROUP=dfwManagementgroup MANAGEMENT_SERVER_DNS= 177424-omgw01.hkg.intensive.int") Wscript.Sleep 150000 'Write this manual install value if 64 bit objshell.Regwrite "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Rackspace\SCOMInstall",1 End If End If MsgBox("Done")