24-5 ������������������������

ڭ̤]iHϥ WSH Ӻ޲zLnACAڭ̥iH IIS AåBCXʽAlXpUG

lɡ]iisProp01.js^G]ǦϰUYi^
// CX IIS Aʽ

iisObj = GetObject("IIS://LocalHost/W3SVC/1/Root");
prop=[
	"AccessFlags",
	"AccessNoRemoteExecute",
	"AccessNoRemoteRead",
	"AccessNoRemoteWrite",
	"AccessRead",
	"AccessScript",
	"AccessSSL",
	"AccessSSL128",
	"AccessSSLFlags",
	"AccessSSLMapCert",
	"AccessSSLNegotiateCert",
	"AccessSSLRequireCert",
	"AccessWrite",
	"AdminACL",
	"AllowKeepAlive",
	"AllowPathInfoForScriptMappings",
	"AnonymousPasswordSync",
	"AnonymousUserName",
	"AnonymousUserPass",
	"AppAllowClientDebug",
	"AppAllowDebugging"];
prop=prop.sort();	// ƧǥHQ[
for (i=0; i<prop.length; i++)
	WScript.Echo("iisObj." + prop[i] + " = " + eval("iisObj."+prop[i]));

榹{AiHoUCGG

iisObj.AccessFlags = 513 iisObj.AccessNoRemoteExecute = false iisObj.AccessNoRemoteRead = false iisObj.AccessNoRemoteWrite = false iisObj.AccessRead = true iisObj.AccessSSL = false iisObj.AccessSSL128 = false iisObj.AccessSSLFlags = 0 iisObj.AccessSSLMapCert = false iisObj.AccessSSLNegotiateCert = false iisObj.AccessSSLRequireCert = false iisObj.AccessScript = true iisObj.AccessWrite = false iisObj.AdminACL = undefined iisObj.AllowKeepAlive = undefined iisObj.AllowPathInfoForScriptMappings = undefined iisObj.AnonymousPasswordSync = true iisObj.AnonymousUserName = IUSR_ROGER-296F8AA10 iisObj.AnonymousUserPass = ZY=\x'aY,-0}C+ iisObj.AppAllowClientDebug = false iisObj.AppAllowDebugging = false HWoǩʽAN IIS Uس]wC

bUCdҤAڭ̥iH͵ؿG

lɡ]iisVirtualDir01.js^G]ǦϰUYi^
// ]w IIS ؿ

//wq}Au IIS://LocalHost/W3SVC/1/RootvAܩw] Web xDؿUإߵؿC
ServiceObj = GetObject("IIS://LocalHost/W3SVC/1/Root");

//ϥΡuCreate("IISWebVirtualDir","ؿW")vkAHإߵؿC
dirName="winTemp";
WScript.Echo("إߵؿG" + dirName);
newVirDir = ServiceObj.Create("IISWebVirtualDir", dirName);

//Pathݩʳ]wؿڪz|C 
newVirDir.Path = "c:\\windows\\temp";

//EnableDirBrowsingݩʳ]wؿO_\sؿC
newVirDir.EnableDirBrowsing = true;

//AccessReadݩʳ]wؿO_\ŪgC
newVirDir.AccessRead = true;
newVirDir.AccessWrite = false;

//̫AϥSetInfokxsMetabaseC
newVirDir.SetInfo();

ҲͪؿO winTempAڵwЪؿO c:\windows\tempCAiHgѡux/tκ޲zu/Internet Information ServicesvӶ} IIS ޲zAHT{ؿ winTemp sbC

ڭ̤]iHϥ WSH ӱ IIS AAШUCdҡG

lɡ]iisControl01.js^G]ǦϰUYi^
// ϥ WSH ӱ IIS
iisObj = GetObject("IIS://LocalHost/W3SVC/1");
iisObj.Pause();
WScript.Echo("Ȱ IIS AI");
iisObj.Continue();
WScript.Echo("~ IIS AI");
iisObj.Stop();
WScript.Echo(" IIS AI");
iisObj.Start();
WScript.Echo("Ұ IIS AI");

bWoӽdҤAڭ̥iH IIS iȰB~BBҰʵC


JScript {]pPΡGΩ WSH