Today, an audit was performed on machines with Photoshop CS installed and having the Technical Director to physically go to each machine. I’m sure there are reporting tools more than likely built into windows, however i’m not aware of any or at least nothing springs to mind. As an after thought I quickly wrote up the following. This script will enumerate a network, and attempt to display the installed software and their version.

Also Monad (MSH, or Microsoft Command Shell) looks very promising for administration considering you can pipeline processes for example directly into an excel document or a chart. It would probably be even simpler to do in MSH too, however I believe each client would have to have MSH installed, although it can call into WMI, or COM objects.

Dim colDomains, colRole
Dim objDomain, objUseDomain, objWMIService, objRole
Dim strComputer, strComputerRole
Dim SearchProduct

Dim MsgOut

'Constants
Const SPACES = " "
'Initialize Section

strComputerRole = Spaces

Title="Search for installed product"
SearchProduct=InputBox(Title,Title,"Adobe")

Set colDomains = GetObject("WinNT:")

For Each objDomain in colDomains
  Set objUseDomain = GetObject ("WinNT://" & objDomain.Name)
  objUseDomain.Filter = Array("Computer")
  ParseComputers
Next

Sub ParseComputers
  On Error Resume Next
  For Each strComputer In objUseDomain
    Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\" & strComputer.Name & "rootcimv2")
    If Err.Number <> 0 Then
      ErrorWrite
    Else
      DetectApplication
    End If
  Next
End Sub

Sub DetectApplication
  On Error Resume Next

  Dim Query

  If SearchProduct <> EMPTY Then
    Query = " WHERE Name LIKE '%"+SearchProduct+"%'"
  End If

  Set colProduct = objWMIService.ExecQuery ("SELECT * FROM Win32_Product"+Query)
  For Each objProduct in colProduct
    MsgOut = MsgOut + objProduct.Name + VBCRLF
  Next
  If Err.Number <> 0 Then
    ErrorWrite
  End If
End Sub

Sub ErrorWrite
  MsgOut = MsgOut + "Error# " & Err.Number & " " & Err.Description & " For computer " & strComputer.Name & " in domain " & objUseDomain.Name & VBCRLF
  Err.clear
  strComputerRole = Spaces
End Sub

'Right Report line to console and clear variable for next iteration

Sub WriteReportLine
  MsgOut = MsgOut + "Domain= " & objUseDomain.Name & " ComputerName= " & strComputer.Name & " Role= " & strComputerRole & VBCRLF
  strComputerRole = SPACES
End Sub

MsgBox MsgOut

  • Share/Bookmark