ActiveXperts Network Monitor
Monitor servers, workstations, devices and applications in your network

Quicklinks


Internet Information Server 5.x Applications and Application Protocols - Scripts

Create an Application in a Web Directory
Create an Out-of-Process Application in a Web Directory
Delete an Out-of-Process Web Application
Disable an Out-of-Process Web Application
Disable a Web Directory Application
Delete a Web Directory Application
Enable an Out-of-Process Web Application
Enable a Web Directory Application
List Applications in an Application Pool
Recycle an Application Pool
Restart a Web Directory Application
Start an Application Pool
Stop an Application Pool
Unload an Application from a Web Directory
Unload an Out-of-Process Web Application
Verify the Status of a Web Directory Application


You can use any of the VBScript programs below in ActiveXperts Network Monitor. Click here for an explanation about how to include scripts in ActiveXperts Network Monitor.



Create an Application in a Web Directory


Creates a Web application in the W3SVC/2142295254/root/aspnet_client_folder directory.
strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/2142295254/root/aspnet_client_folder")

objIIS.AppCreate(False)
	

Create an Out-of-Process Application in a Web Directory


Creates an out-of-process Web application in the W3SVC/2142295254/root/aspnet_client_folder directory.
Const OUT_OF_PROCESS = 1
 
strComputer = objNetwork.ComputerName
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/2142295254/root/aspnet_client_folder")

objIIS.AppCreate2 OUT_OF_PROCESS
	

Delete an Out-of-Process Web Application


Deletes an out-of-process Web application in the W3SVC/2142295254/root/aspnet_client_folder directory.
strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/2142295254/root/aspnet_client_folder")

objIIS.AppDeleteRecursive
	

Disable an Out-of-Process Web Application


Disables an out-of-process Web application in the W3SVC/2142295254/root/aspnet_client_folder directory.
strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/2142295254/root/aspnet_client_folder")

objIIS.AppDisableRecursive
	

Disable a Web Directory Application


Disables the Web application in the W3SVC/2142295254/root/aspnet_client_folder directory.
strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/2142295254/root/aspnet_client_folder")

objIIS.AppDisable
	

Delete a Web Directory Application


Deletes the Web application in the W3SVC/2142295254/root/aspnet_client_folder directory.
strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/2142295254/root/aspnet_client_folder")

objIIS.AppDelete
	

Enable an Out-of-Process Web Application


Enables an out-of-process Web application in the W3SVC/2142295254/root/aspnet_client_folder directory.
strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/2142295254/root/aspnet_client_folder")

objIIS.AppEnableRecursive
	

Enable a Web Directory Application


Enables the Web application in the W3SVC/2142295254/root/aspnet_client_folder directory.
strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/2142295254/root/aspnet_client_folder")

objIIS.AppEnable
	

List Applications in an Application Pool


Returns a list of all the applications in the MSSharePointAppPool application pool.
strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/AppPools/MSSharePointAppPool")
arrApps = objIIS.EnumAppsInPool
 
For i = 0 to Ubound(arrApps)
    Wscript.Echo arrApps(i)
Next
	

Recycle an Application Pool


Recycles the application pool MSSharePointAppPool.
strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/AppPools/MSSharePointAppPool")

objIIS.Recycle
	

Restart a Web Directory Application


Restarts the Web application in the W3SVC/2142295254/root/aspnet_client_folder directory.
strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/2142295254/root/aspnet_client_folder")

objIIS.ASPAppRestart
	

Start an Application Pool


Starts the application pool MSSharePointAppPool.
strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/AppPools/MSSharePointAppPool")

objIIS.Start
	

Stop an Application Pool


Stops the MSSharePointAppPool application pool.
strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/AppPools/MSSharePointAppPool")

objIIS.Stop
	

Unload an Application from a Web Directory


Unloads the Web application in the W3SVC/2142295254/root/aspnet_client_folder directory.
strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/2142295254/root/aspnet_client_folder")

objIIS.AppUnload
	

Unload an Out-of-Process Web Application


Unloads an out-of-process Web application in the W3SVC/2142295254/root/aspnet_client_folder directory.
strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/2142295254/root/aspnet_client_folder")

objIIS.AppUnloadRecursive
	

Verify the Status of a Web Directory Application


Retrieves the status of the Web application in the W3SVC/2142295254/root/aspnet_client_folder directory.
strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/2142295254/root/aspnet_client_folder")
strStatus = objIIS.AppGetStatus2
 
If strStatus = 2 Then
    Wscript.Echo "The application is running."
ElseIf strStatus = 3 Then
    Wscript.Echo "The application is stopped."
Else
    Wscript.Echo "The status of this application could not be determined."
End If