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, ms xml is probably not installed strFile = windowsdir & "\system32\msxml6.dll" If objFSO.FileExists(strFile) Then '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") 'Copy the install file to the local machines C: based on the version of the OS. If OsType = "x86" Then objFSO.CopyFile "\\media.lon.rackspace.com\SoftwareImages\Microsoft Applications\Microsoft SCOM\Agents\i386\MOMAgent.msi", "C:\MomAgent386.msi", OverwriteExisting Else objFSO.CopyFile "\\media.lon.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=lonManagementgroup MANAGEMENT_SERVER_DNS=204240-omms01.lon.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=lonManagementgroup MANAGEMENT_SERVER_DNS=204240-omms01.lon.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 MsgBox("MS XML 6 or higher needs to be installed before you can install the SCOM Agent") End If MsgBox("Done")