bsharath
asked on
Getting all installed apps from add remove programs of remote computers into excel
Hi,
I need a way to get all the installed applications in a machine to a excel file.I want to do this remotely.
Regards
Sharath
I need a way to get all the installed applications in a machine to a excel file.I want to do this remotely.
Regards
Sharath
ASKER
I get this.
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Find all softwares installed in a remote machine.vbs
Line: 80
Char: 2
Error: The remote server machine does not exist or is unavailable: 'GetObject'
Code: 800A01CE
Source: Microsoft VBScript runtime error
-------------------------- -
OK
-------------------------- -
--------------------------
Windows Script Host
--------------------------
Script: C:\Find all softwares installed in a remote machine.vbs
Line: 80
Char: 2
Error: The remote server machine does not exist or is unavailable: 'GetObject'
Code: 800A01CE
Source: Microsoft VBScript runtime error
--------------------------
OK
--------------------------
oops forgot error checking, sorry brb.
zf
zf
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That one run ok?
zf
zf
ASKER
Thanks a lot i get this working great.
I get the output like this
Dev-chen-pc2193 Microsoft Office Enterprise 2007 Microsoft Internationalized Domain
Dev-chen-pc1728 Beyond Compare Version 2.2.7 Belarc Advisor 7.2 Citrix ICA
Any way to get this sorted.
I mean scan all rows and sort all Microsoft Office Enterprise 2007 in the same row and another software if detected in the same row and so on.
I get the output like this
Dev-chen-pc2193 Microsoft Office Enterprise 2007 Microsoft Internationalized Domain
Dev-chen-pc1728 Beyond Compare Version 2.2.7 Belarc Advisor 7.2 Citrix ICA
Any way to get this sorted.
I mean scan all rows and sort all Microsoft Office Enterprise 2007 in the same row and another software if detected in the same row and so on.
I think the best way for you to handle the sort is to import this output into a database(inventory) and then you can query the database for all machines that say have "MS Office Enterprise 2007".
With the shear volume of data youve been collecting on all the pc's with these scripts at this point a database is going to be your only realistic method of keeping accurate track and orginization of all this information. Unless this is a one time shot your going to end up will csv files coming out your ears if you dont find somewhere to collectivly put the data. And if it is a one time shot, sort the data in excel.
zf
With the shear volume of data youve been collecting on all the pc's with these scripts at this point a database is going to be your only realistic method of keeping accurate track and orginization of all this information. Unless this is a one time shot your going to end up will csv files coming out your ears if you dont find somewhere to collectivly put the data. And if it is a one time shot, sort the data in excel.
zf
Output into a single excel csv doc
pcname,app,app,app,app
'===Start copy: getapps.vbs===
' --------------------------
' getappversions.vbs
' 'Sample VBScript to query remote computers
' 'and return versions for word and excel.
' ''Author Riley C. aka ZooFan
' '''Version 2.4 - August 2007
' ''''https://www.experts-exchange.com question ID: 22734176
' --------------------------
'
Option Explicit
Const ForReading = 1, ForWriting = 2, ForAppending = 3 'FileObject Access Type
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 'FileObject Format Type
Dim objFso
Dim objWshshell
Dim objOutputFile
Dim strCurPath
Dim dte
Dim tme
Dim arrPCnames()
Dim intPCLoop
Dim strNewFile
Dim strPCFile
Dim objPCOutputFile
Set objFso = CreateObject("Scripting.Fi
Set objWshshell = WScript.CreateObject("WScr
strCurPath = CreateObject("Scripting.Fi
dte = Replace(FormatDateTime(dat
tme = Replace(Replace(FormatDate
strNewFile = strCurPath & "\" & tme & "_" & dte & ".csv"
strPCFile = InputBox("Please enter the full path and file" & VbCrLf & "name of the file with the computer names.","Get application versions from remote computers..")
If Not objFso.FileExists(strPCFil
MsgBox "You must enter a valid full path and file name!",vbOKOnly,"Get application versions from remote computers.."
WScript.Quit(0)
Elseif strPCFile = "" Then
MsgBox "You must enter a filename!",vbOKOnly,"Get application versions from remote computers.."
WScript.Quit(0)
Else
Call createoutputfile(strNewFil
Call readpclist(strPCFile)
Set objOutputFile = objFso.OpenTextFile(strNew
For intPCLoop = LBound(arrPCnames) To UBound(arrPCnames)
objOutputFile.WriteLine("C
objOutputFile.WriteLine(ar
Next
objOutputFile.Close
MsgBox "File has been processed, and results saved in " & strNewFile ,vbOKOnly,"Get application versions from remote computers."
End If
WScript.Quit(0)
Sub readpclist(strPcList)
Dim objPCnames
Dim objReadFile
Dim intLneCount
Set objPCnames = objFso.GetFile(strPCFile)
Set objReadFile = objPCnames.OpenAsTextStrea
Do Until objReadFile.AtEndOfStream
ReDim Preserve arrPCnames(intLneCount)
arrPCnames(intLneCount) = objReadFile.ReadLine
intLneCount = intLneCount + 1
Loop
objReadFile.Close
End sub
Sub createoutputfile(strNewFil
If objFso.FileExists(strNewFi
objFso.deleteFile(strNewFi
Else
Set objOutputFile = objFso.CreateTextFile(strN
objOutputFile.Close
End If
End Sub
Function InstalledApplications(pcNa
Dim appsFile
Dim oRegistry
Dim sBaseKey
Dim iRc
Dim sKey
Dim arSubKeys()
Dim sValue
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
Set oRegistry = GetObject("winmgmts://" & pcName & "/root/default:StdRegProv"
sBaseKey = "SOFTWARE\Microsoft\Window
iRC = oRegistry.EnumKey(HKLM, sBaseKey, arSubKeys)
For Each sKey In arSubKeys
iRC = oRegistry.GetStringValue(H
If iRC <> 0 Then
oRegistry.GetStringValue HKLM, sBaseKey & sKey, "QuietDisplayName", sValue
End If
If sValue <> "" Then
InstalledApplications = InstalledApplications & sValue & ","
End If
Next
End Function
'===End copy: getapps.vbs===
any problems let me know. And I am alomost done with the script to create user folders with permissions but time to go to work so will not be able to finish until this evening.
zf