' created per requirement given by Security Dept (originally scripted in PS by Phil but I was asked to create a vbs version for deployment via TEM) ' configures HP Management Homepage the same way Phil's script did Option Explicit Dim oFSO, xmldoc, xNode, oWMI, oService Set oFSO = CreateObject("Scripting.FileSystemObject") If oFSO.FileExists("c:\hp\hpsmh\conf\smhpd.xml") Then Set xmldoc = CreateObject("msxml2.domdocument") xmldoc.setProperty "SelectionLanguage", "XPath" xmldoc.load("c:\hp\hpsmh\conf\smhpd.xml") Set xNode = xmldoc.documentElement.selectSingleNode("ip-binding") If xNode.text <> "true" Then ' then make it true xNode.text = "true" xmldoc.save "c:\hp\hpsmh\conf\smhpd.xml" WScript.Sleep(500) 'above changes config file value of 'ip-binding' to true and writes the file back to disk, giving it .5 seconds to write to disk before restarting the service which will pick up the new setting 'Stop Service Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Set oService = oWMI.Get("Win32_Service.Name='SysMgmtHp'") oService.StopService() Do WScript.Sleep(300) ' get fresh instance so updated 'State' can be checked Set oService = oWMI.Get("Win32_Service.Name='SysMgmtHp'") Loop While oService.State <> "Stopped" ' if we're here it stopped... start it up again Set oService = oWMI.Get("Win32_Service.Name='SysMgmtHp'") oService.StartService End If End If