Question

Locked

Software license lookup

By wesley.chin ·
Is there something that can generate a comprehensive listing of software licenses on a machine? Better yet, is there something that will sniff a network and generate a listing of software licenses for every machine on the network?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Symantec Altiris Software Inventory

by robo_dev In reply to Software license lookup

http://www.altiris.com/

Of course there is no such thing as a 'license', you can sniff and detect applications, but licenses exist on on paper.

Collapse -

There are many options

by IC-IT In reply to Software license lookup

Software metering or inventory applications or scripting.
Here is a sample script I am playing with. It returns all software that would be found in the add/remove programs listing. It looks at an AD OU and builds an array of computer names. Then it goes to each computer and pulls the software list into an Excel Workbook; each sheet is named after the computer. It is a bit rough, but works nicely. I am not sure how the formatting will display here but if you want here it is. Save it as a vbs file.


' This script gets the computer list from AD Domain Controller and then queries each computer
' Using WMI.
' For every computer it generates a Sheet in a Excel with the list of installed
' applications and service packs and then it saves the excel file.
' It accepts three parameters from command line, all optionals
' USERNAME and PASSWORD : these credentials are intented for the WMI authentication
' They are useful if there are problmes with WMI ore you are executing this script not as Domain Admin
' FILE: the name of the output Excel file. If non prodived the default is c:\assetsoft.xls
' Note: customize the ldapString!
' Thanks to TECHNET for WMI function to get the Inventory
' BW you can run this from a command line and it will use your current logon credentials or you can add
' the arguments in order i.e. insoft.vbs username password filename
' another option is to add your username password to the proper place on the line I have rem ed for you below

Option Explicit
WScript.interactive=False

Dim EXCL ' Excel Application object
Dim currentCell, oSheet
Dim fileName 'output Excel file Name
Dim Computers 'Array that must be filled with Computer names got from Active Directory
Dim strEntry1a,strEntry1b,strEntry2,strEntry3,strEntry4
Dim strEntry5,arrSubkeys,intRet1,strSubkey,strValue1,strValue2,strValue3,strValue4
Dim intValue1,intValue2,intValue3,intValue4,intValue5
Dim SWBemlocator, strComputer,WMIService,objReg
Set EXCL= WScript.CreateObject("Excel.Application") 'Creates the Excel Application Object
Dim username 'credentials that can be used for WMI access
Dim password 'credentials that can be used for WMI access
Dim ldapString

' Remember they work backwards and it will return all computers in that OU and any contained folders
' example if you change ou=test workstations to ou=ec workstations, you will get the testing ou also

ldapString="LDAP://OU=test workstations,OU=Workstations,OU=east,OU=production,DC=your-domain,DC=penguins,DC=com" 'IMPORTANT: Customize it!!!

currentCell=1

EXCL.Visible=True 'it's better to set it to False. But if you want to watch progresses leave it True
EXCL.Workbooks.Add
Set oSheet=EXCL.Workbooks.Item(1)
Sub writeExcel(valore,colonna)
EXCL.Cells(currentCell,colonna)=valore
End Sub

Sub fillArray(Computers)

Const ADS_SCOPE_SUBTREE = 2
Dim computerArray(), indice
Dim objConnection,objCommand,objRecordset
indice=0
ReDim computerArray(1)
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"

Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = _
"Select Name from '" & ldapString & "' " _
& "Where objectClass='computer'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objRecordset = objCommand.Execute
objRecordSet.MoveFirst

Do Until objRecordset.EOF
computerArray(indice)=objRecordSet.Fields("Name").Value
indice=indice+1
ReDim Preserve computerArray(indice)
objRecordset.MoveNext
Loop
ReDim preserve computerArray(UBound(computerArray)-1)
Computers=computerArray
End Sub

'You can use ADSI but if you have not AD you must fill manually Computers array.
'In that case you must comment out the fillArray call.
'Computers=Array("PSP01WS1","PSP01WS2")

Call fillArray(Computers)

' This is the two lines if you want to add the username then password as part of the script

If WScript.Arguments.Named.Exists("USERNAME") Then username=WScript.Arguments.Named("USERNAME") else username=""
If WScript.Arguments.Named.Exists("PASSWORD") Then Password=WScript.Arguments.Named("PASSWORD") else password=""
If WScript.Arguments.Named.Exists("FILE") Then Password=WScript.Arguments.Named("FILE") else fileName="c:\assetsoft.xls"

Const strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
strEntry1a = "DisplayName"
strEntry1b = "QuietDisplayName"
strEntry2 = "InstallDate"
strEntry3 = "VersionMajor"
strEntry4 = "VersionMinor"
strEntry5 = "EstimatedSize"

Set SWBemlocator = CreateObject("WbemScripting.SWBemlocator")
For Each strComputer In Computers

EXCL.Workbooks.Item(1).Sheets.Add
oSheet.ActiveSheet.Name=strComputer

Excl.Cells(1, 1).Formula = "Display Name"
Excl.Cells(1, 2).Formula = "Install Date"
Excl.Cells(1, 3).Formula = "Version"
Excl.Cells(1, 5).Formula = "Est Size"



currentCell=currentCell+1
On Error Resume next
Set WMIService = SWBemlocator.ConnectServer(strComputer,"\root\default",USERNAME,PASSWORD)
Set objReg=WMIService.Get("StdRegProv")
objReg.EnumKey HKLM, strKey, arrSubkeys
For Each strSubkey In arrSubkeys
intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, strEntry1a, strValue1)
If intRet1 <> 0 Then
objReg.GetStringValue HKLM, strKey & strSubkey, strEntry1b, strValue1
End If
If strValue1 <> "" Then
call writeExcel(strValue1,1)
End If
objReg.GetStringValue HKLM, strKey & strSubkey, strEntry2, strValue2
If strValue2 <> "" Then
call writeExcel(strValue2,2)
End If
objReg.GetDWORDValue HKLM, strKey & strSubkey, strEntry3, intValue3
objReg.GetDWORDValue HKLM, strKey & strSubkey, strEntry4, intValue4
If intValue3 <> "" Then
call writeExcel(intValue3 & "." & intValue4,3)
End If
objReg.GetDWORDValue HKLM, strKey & strSubkey, strEntry5, intValue5
If intValue5 <> "" Then
Call writeExcel(Round(intValue5/1024, 3),5)
End If
if strvalue1<>"" then currentCell=currentCell+1
Next
currentCell=1
Excl.Columns("A:AY").EntireColumn.AutoFit 'To adjust the column's width.
' added to clear the subarray original script carried data to all remaining sheets
arrSubkeys = ""

Next
oSheet.SaveAs(filename)
oSheet.Close
EXCL.Quit
Set EXCL=Nothing

' to view the final product just cancel the save

Collapse -

Does not work

by wesley.chin In reply to There are many options

It does not work here. There is no server here.

Back to Networks Forum
5 total posts (Page 1 of 1)  

Hardware Forums