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 !
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