Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listing applications over Network

Status
Not open for further replies.

hackoo

Programmer
Jan 31, 2003
28
TN
HI !
Recently I was asked in my company to list all the applications / software installed on the network.
Would you know a script that allows you to list applications / software installed on computers in a domain with multiple subnets.
For example when i launch the script it ask me what Subnets want to deal with and which account to connect to remote machines and then I'll put this in as an excel file with column "Machine name, application name, version, serial software"
I have just this script "Inventory in a CSV file on a local machine"
I wonder how can i turn this script to make it working with computers in a domain with multiple subnets.
Thank you for your Reply !
Code:
Function inventaire
Set oShell = CreateObject("wscript.Shell")
Set env = oShell.environment("Process")
strComputer = env.Item("Computername")
Const HKEY_LOCAL_MACHINE = &H80000002
Const UnInstPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
".\root\default:StdRegProv")
oReg.EnumKey HKEY_LOCAL_MACHINE, UnInstPath, arrSubKeys
software = "*******************************" & Now & "****************************" & vbCrLf
software = software & "*******************************Logiciels installés******************************" & vbCrLf
For Each subkey In arrSubKeys
        'MsgBox subkey
        If Left (subkey, 1) <> "{" Then
                software = software & subkey & vbCrLf
        End If
Next
software = software & "*********************************************************" & vbCrLf
 
Set fso = CreateObject("Scripting.FileSystemObject")
 
'Détermine si le fichier csv existe déjà ou s'il doit le créer
If Not fso.FileExists("inventaire " & strComputer & ".csv") Then
        set ts = fso.CreateTextFile("Inventaire " & strComputer & ".csv", True)
Else
        set ts = fso.OpenTextFile("Inventaire " & strComputer & ".csv", 2, True)
End If
ts.write software
inventaire=software
call Explorer("Inventaire " & strComputer & ".csv")
end function
 
Function Explorer(File)
'  Ouverture du Dossier par l'explorateur windows
If Err.Number = vbEmpty Then
   Set objShell = CreateObject("WScript.Shell")
   objShell.Run ("Explorer" & " " & File & "\")
Else
MsgBox "VBScript Error: " & Error(Err.Number)
End If
end Function
 
Call inventaire


 
you can connect to remote WMI provider, then use the WMI classes.
better approach(?) would be to run this audit process on each client, via logonscript or grouppolicy or startup script, have each client write its info to a central share

I Hear, I Forget
I See, I Remember
I Do, I Understand

Ronald McDonald
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top