//------------------------------------------------------------------- // VOS+ SharePoint Warmup // // Usage: cscript.exe WarmUpServer.js // // Description: This script is used to warm-up a SharePoint WFE. // The script requests url's to initiate the JIT. //------------------------------------------------------------------- // Version: Integ V1.0 // History: 2008-03-26 created new version (beatg) // //------------------------------------------------------------------- // List of url's that will be requested WScript.Echo(getStatus("http://servername")) //------------------------------------------------------------------- // Requests supplied url. Returns string containing url and // status code. //------------------------------------------------------------------- function getStatus(strUrl) { var strResult = ""; try { // Instantiate a WinHttpRequest object. var HttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1"); // Set time-outs. HttpReq.SetTimeouts(0, 60000, 30000, 180000); // Open an HTTP connection. HttpReq.Open("GET", strUrl, false); // Automatically send user credentials. HttpReq.SetAutoLogonPolicy(0); // Send the HTTP Request. HttpReq.Send(); // Display the response status strResult = strUrl + ": " + HttpReq.Status + " - " + HttpReq.StatusText; } catch (objError) { strResult = objError + "\n" strResult += "WinHTTP returned error: " + (objError.number & 0xFFFF).toString() + "\n\n"; strResult += objError.description; } return strResult; }