hjafary
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 10/14/2011
-
Status: offline
|
VbScript ::: need help
Friday, October 14, 2011 10:37 AM
( permalink)
Dear people, i am new in vbscripting and i wanna realize three scripts for: 1. making a list from services running on the servers in Servers.txt 2. making a list of the shares available on the servers in Servers.txt 3. making a list of ip-address of the servers in Servers.txt Can anyone help me out of this problem?... thanks for your help. Regards, Hamid -------------- For the services i have found a script but i can not make it so that it uses the Servers.txt[/style] file instead of the local computer. any help is appreciated. strComputer = "." Const ForAppending = 8 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objLogFile = objFSO.OpenTextFile("c:\scripts\service_list.csv", _ ForAppending, True) objLogFile.Write _ ("System Name,Service Name,Service Type,Service State, Exit " _ & "Code,Process ID,Can Be Paused,Can Be Stopped,Caption," _ & "Description,Can Interact with Desktop,Display Name,Error " _ & "Control, Executable Path Name,Service Started," _ & "Start Mode,Account Name ") objLogFile.Writeline Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colRunningServices = objWMIService.ExecQuery("Select * from Win32_Service") For Each objService in colRunningServices Wscript.Echo objService.DisplayName & VbTab & objService.State & VbTab & objService.Startmode Next
<message edited by hjafary on Friday, October 14, 2011 10:54 AM>
|
|
|
|