/ Published in: Visual Basic
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
resultPath = "c:\Scripts\Resultados\AppPools.txt" set shell = WScript.CreateObject("WScript.Shell") strComputer = shell.ExpandEnvironmentStrings("%ComputerName%") Set objWMIService = GetObject ("winmgmts:{authenticationLevel=pktPrivacy}\\" & strComputer & "\root\microsoftiisv2") Set colItems = objWMIService.ExecQuery ("Select * from IIsApplicationPoolSetting") Dim fso, tf Set fso = CreateObject("Scripting.FileSystemObject") Set tf = fso.CreateTextFile(resultPath, True) For Each objItem in colItems tf.WriteLine( VbCrLf & "--------------------------------------------------" & VbCrLf ) tf.WriteLine("Name: " & objItem.Name) Dim identidad,i i = objItem.AppPoolIdentityType Select Case i Case 0 identidad = "Local System" Case 1 identidad = "Local Service" Case 2 identidad = "Network Service" Case 3 identidad = objItem.WAMUserName Case 4 identidad = "ApplicationPoolIdentity" End Select tf.WriteLine("Identidad: " & identidad) tf.WriteLine("WAM User Name: " & objItem.WAMUserName) tf.WriteLine("WAM User Password: " & objItem.WAMUserPass) Next tf.WriteLine( VbCrLf & "--------------------------------------------------") tf.Close shell.Run "notepad " & resultPath