Dear All, I was looking for some help in terms of understanding what script is being used on this site and how and where can i get it? c l o u d c o m p u t i n g l e a d e r s . c o m I hope this is the right section, to be honest I could not find any other section best suited for this question. Thank You
If you mean the forum script it's http://www.vbulletin.com/ if you mean that c l o u d whatever it's probably custom built.
My solution follows, but a few points: 1. It takes awhile to enumerate all of the software on a computer. The program indicates progress to the user (and allows the user to abort). A Vista computer with lots of software can take several minutes. 2. The program requires Microsoft Excel and Internet Explorer on the computer where the program runs. 3. You may need to configure your firewall to allow access. 4. The user should be administrator on the computers. Being a member of "Domain Admins" should give you the necessary permissions. 5. Not all software is documented. I think everything in Control Panel, Add/Remove Programs is included. 6. The spreadsheet can get large. I had well over 100 columns. 7. I made no attempt to format the Excel spreadsheet. ======== ' InventorySW.vbs ' VBScript program to inventory software on computers in the domain. Option Explicit Dim strComputer, strDN Dim objShell, objFSO, strTemp, strTempFile Dim objRootDSE, strRootDomain, adoConnection, adoCommand, strQuery Dim adoRecordset, strAttributes, objRemote, intCount Dim strExcelPath, objExcel, objSheet, intRow Dim colSoftware, objSoftware Dim objIE, strIETitle, blnFlag, strPrevious, strStatus Dim adoSoftware, objComputerList, intCol, objSWList, strName Const ADS_CHASE_REFERRALS_SUBORDINATE = &H20 Const adVarChar = 200 Const MaxCharacters = 255 ' Check for required argument. If (Wscript.Arguments.Count <> 1) Then Wscript.Echo "Argument <FileName> required. For example" _ & vbCrLf & "cscript Inventory.vbs ""c:\MyFolder\Inventory.xls""" Wscript.Quit End If ' Spreadsheet file name to be created. strExcelPath = Wscript.Arguments(0) ' Set IE display box title. Dashes ("-") are to move the Microsoft title ' appended to the title we specify out of view. ' blnFlag is set to False when the user closes the IE display box. strIETitle = "Computer Inventory" & String(60, "-") blnFlag = True Set objShell = CreateObject("Wscript.Shell") ' Initialize display box with initial message. InitIE "Program Initializing..." ' Determine DNS domain name from RootDSE object. On Error Resume Next Set objRootDSE = GetObject("LDAP://RootDSE") If (Err.Number <> 0) Then On Error GoTo 0 MsgIE "IE_Quit" Wscript.Echo "Domain not found, program aborted." _ & vbCrLf & "You may not be logged into a domain." Wscript.Quit End If On Error GoTo 0 strRootDomain = objRootDSE.Get("rootDomainNamingContext") ' Bind to Excel. On Error Resume Next Set objExcel = CreateObject("Excel.Application") If (Err.Number <> 0) Then On Error GoTo 0 MsgIE "IE_Quit" Wscript.Echo "Excel application not found." _ & vbCrLf & "Program aborted." Wscript.Quit End if On Error GoTo 0 ' Setup dictionary object of computers. Set objComputerList = CreateObject("Scripting.Dictionary") objComputerList.CompareMode = vbTextCompare ' Setup dictionary object of software titles. Set objSWList = CreateObject("Scripting.Dictionary") objSWList.CompareMode = vbTextCompare ' Use ADO to search Active Directory for all computers. Set adoCommand = CreateObject("ADODB.Command") Set adoConnection = CreateObject("ADODB.Connection") adoConnection.Provider = "ADsDSOObject" adoConnection.Open = "Active Directory Provider" adoCommand.ActiveConnection = adoConnection ' Retrieve attributes. strAttributes = "sAMAccountName,distinguishedName" strQuery = "<LDAP://" & strRootDomain & ">;" _ & "(ObjectCategory=computer);" & strAttributes & ";subtree" adoCommand.CommandText = strQuery adoCommand.Properties("Page Size") = 100 adoCommand.Properties("Timeout") = 30 adoCommand.Properties("Cache Results") = False adoCommand.Properties("Chase Referrals") = _ ADS_CHASE_REFERRALS_SUBORDINATE Set adoRecordset = adoCommand.Execute Set objFSO = CreateObject("Scripting.FileSystemObject") ' Specify temporary file to save ping results. strTemp = objShell.ExpandEnvironmentStrings("%TEMP%") strTempFile = strTemp & "\RunResult.tmp" ' Setup disconnected recordset. Set adoSoftware = CreateObject("ADODB.Recordset") adoSoftware.Fields.Append "Computer", adVarChar, MaxCharacters adoSoftware.Fields.Append "DN", adVarChar, MaxCharacters adoSoftware.Fields.Append "WMI", adVarChar, MaxCharacters adoSoftware.Fields.Append "Vendor", adVarChar, MaxCharacters adoSoftware.Fields.Append "Name", adVarChar, MaxCharacters adoSoftware.Fields.Append "Version", adVarChar, MaxCharacters adoSoftware.Fields.Append "InstallDate", adVarChar, MaxCharacters adoSoftware.Open ' Enumerate computer objects. intRow = 1 intCol = 1 strPrevious = "" strStatus = "(none)" Do Until adoRecordset.EOF strComputer = adoRecordset.Fields("sAMAccountName").Value ' Remove trailing "$". strComputer = Left(strComputer, Len(strComputer) - 1) objComputerList(strComputer) = intRow strDN = adoRecordset.Fields("distinguishedName").Value MsgIE "Searching computer: " & strComputer _ & vbCrLf & "Previous: " & strPrevious & strStatus _ & vbCrLf & "Total documented: " & (intRow - 1) _ & vbCrLf & "To abort, close this box" strPrevious = strComputer If (blnFlag = False) Then ' Quit Excel. objExcel.Application.Quit ' Clean up. adoRecordset.Close adoConnection.Close If (objFSO.FileExists(strTempfile) = True) Then objFSO.DeleteFile(strTempFile) End If Wscript.Echo "Program Aborted" Wscript.Quit End If ' Ping computer to see if online. If (IsConnectible(strComputer, 1, 750) = True) Then ' Connect to computer with WMI. On Error Resume Next Set objRemote = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate," _ & "authenticationLevel=Pkt}!\\" _ & strComputer & "\root\cimv2") If (Err.Number <> 0) Then On Error GoTo 0 adoSoftware.AddNew adoSoftware("Computer") = strComputer adoSoftware("DN") = strDN adoSoftware("WMI") = "WMI Not Installed" adoSoftware("Name") = "" adoSoftware("Vendor") = "" adoSoftware("InstallDate") = "" adoSoftware("Version") = "" adoSoftware.Update strStatus = " no WMI" Else Set colSoftware = objRemote.ExecQuery _ ("SELECT * FROM Win32_Product") If (Err.Number <> 0) Then On Error GoTo 0 adoSoftware.AddNew adoSoftware("Computer") = strComputer adoSoftware("DN") = strDN adoSoftware("WMI") = "Win32_Product class not available" adoSoftware("Name") = "" adoSoftware("Vendor") = "" adoSoftware("InstallDate") = "" adoSoftware("Version") = "" adoSoftware.Update strStatus = " Win32_Product not available" Else intCount = colSoftware.Count If (Err.Number <> 0) Then On Error GoTo 0 adoSoftware.AddNew adoSoftware("Computer") = strComputer adoSoftware("DN") = strDN adoSoftware("WMI") = "Win32_Product class failed" adoSoftware("Name") = "" adoSoftware("Vendor") = "" adoSoftware("InstallDate") = "" adoSoftware("Version") = "" adoSoftware.Update strStatus = " Win32_Product failed" Else On Error GoTo 0 For Each objSoftware In colSoftware adoSoftware.AddNew adoSoftware("Computer") = strComputer adoSoftware("DN") = strDN adoSoftware("WMI") = "WMI Installed" adoSoftware("Name") = objSoftware.Name adoSoftware("Vendor") = objSoftware.Vendor adoSoftware("InstallDate") = objSoftware.InstallDate adoSoftware("Version") = objSoftware.Version adoSoftware.Update strName = objSoftware.Vendor & "\" & objSoftware.Name If (objSWList.Exists(strName) = False) Then objSWList(strName) = intCol intCol= intCol + 1 End If Next strStatus = " documented" End If End If If (blnFlag = False) Then ' Quit Excel. objExcel.Application.Quit ' Clean up. adoRecordset.Close adoConnection.Close If (objFSO.FileExists(strTempfile) = True) Then objFSO.DeleteFile(strTempFile) End If Wscript.Echo "Program Aborted" Wscript.Quit End If End If Else adoSoftware.AddNew adoSoftware("Computer") = strComputer adoSoftware("DN") = strDN adoSoftware("WMI") = "Computer Not Found" adoSoftware("Name") = "" adoSoftware("Vendor") = "" adoSoftware("InstallDate") = "" adoSoftware("Version") = "" adoSoftware.Update strStatus = " not on line" End If intRow = intRow + 1 adoRecordset.MoveNext Loop adoRecordset.Close MsgIE "Creating Spreadsheet" _ & vbCrLf & "To abort, close this box" ' Create new workbook. objExcel.Workbooks.Add ' Bind to worksheet. Set objSheet = objExcel.ActiveWorkbook.Worksheets(1) objSheet.Name = "Software Inventory" adoSoftware.MoveFirst Do Until adoSoftware.EOF strName = adoSoftware.Fields("Vendor").Value _ & "\" & adoSoftware.Fields("Name").Value strComputer = adoSoftware.Fields("Computer").Value MsgIE "Documenting computer: " & strComputer _ & vbCrLf & "To abort, close this box" If (blnFlag = False) Then 'Save spreadsheet and close the workbook. On Error Resume Next objExcel.ActiveWorkbook.SaveAs strExcelPath If (Err.Number <> 0) Then On Error GoTo 0 Wscript.Echo "Spreadsheet could not be saved as " _ & strExcelPath _ & vbCrLf & "The path may be invalid." strExcelPath = "" End If On Error GoTo 0 objExcel.ActiveWorkbook.CLose ' Quit Excel. objExcel.Application.Quit ' Clean up. objRecordset.Close objConnection.Close If (objFSO.FileExists(strTempFile) = True) Then objFSO.DeleteFile(strTempFile) End If Wscript.Echo "Program Aborted" If (strExcelPath <> "") Then Wscript.Echo "See spreadsheet " & strExcelPath End If Wscript.Quit End If If (strName = "\") Then intCol = 0 Else intCol = objSWList(strName) + 1 End If intRow = objComputerList(strComputer) * 3 If (objSheet.Cells(intRow, 1).Value = "") Then objSheet.Cells(intRow, 1).Value = strComputer objSheet.Cells(intRow + 1, 1).Value = adoSoftware.Fields("DN").Value objSheet.Cells(intRow + 2, 1).Value = adoSoftware.fields("WMI").Value End If If (intCol > 0) Then If (objSheet.Cells(1, intCol).Value = "") Then objSheet.Cells(1, intCol).Value = adoSoftware.Fields("Vendor").Value objSheet.Cells(2, intCol).Value = adoSoftware.Fields("Name").Value End If objSheet.Cells(intRow, intCol).Value = adoSoftware.Fields("InstallDate").Value objSheet.Cells(intRow + 1, intCol).Value = adoSoftware.Fields("Version").Value End If adoSoftware.MoveNext Loop adoSoftware.Close ' Save spreadsheet and close the workbook. On Error Resume Next objExcel.ActiveWorkbook.SaveAs strExcelPath If (Err.Number <> 0) Then On Error GoTo 0 Wscript.Echo "Spreadsheet could not be saved as " & strExcelPath _ & vbCrLf & "The path may be invalid." strExcelPath = "" End If On Error GoTo 0 objExcel.ActiveWorkbook.Close ' Quit Excel. objExcel.Application.Quit ' Clean up. adoConnection.Close If (objFSO.FileExists(strTempfile) = True) Then objFSO.DeleteFile(strTempFile) End If ' Close display box. MsgIE "IE_Quit" Wscript.Echo "Done" If (strExcelPath <> "") Then Wscript.Echo "See spreadsheet " & strExcelPath End If Function IsConnectible(ByVal strHost, ByVal intPings, ByVal intTO) ' Returns True if strHost can be pinged. ' Based on a program by Alex Angelopoulos and Torgeir Bakken. Dim objFile, strResults If (intPings = "") Then intPings = 2 End If If (intTO = "") Then intTO = 750 End If Const OpenAsDefault = -2 Const FailIfNotExist = 0 Const ForReading = 1 objShell.Run "%comspec% /c ping -n " & intPings & " -w " & intTO _ & " " & strHost & ">" & strTempFile, 0, True Set objFile = objFSO.OpenTextFile(strTempFile, ForReading, _ FailIfNotExist, OpenAsDefault) strResults = objFile.ReadAll objFile.Close Select Case InStr(strResults, "TTL=") Case 0 IsConnectible = False Case Else IsConnectible = True End Select End Function Sub MsgIE(ByVal strMsg) ' Subroutine to display message in IE box and detect when the ' box is closed by the program or the user. On Error Resume Next If (strMsg = "IE_Quit") Then blnFlag = False objIE.Quit Else objIE.Document.Body.InnerText = strMsg If (Err.Number <> 0) Then Err.Clear blnFlag = False Exit Sub End If objShell.AppActivate strIETitle End If End Sub Sub InitIE(ByVal strMsg) ' Subroutine to initialize the IE display box. Dim intWidth, intHeight, intWidthW, intHeightW Set objIE = CreateObject("InternetExplorer.Application") objIE.ToolBar = False objIE.StatusBar = False objIE.Resizable = False objIE.Navigate("about:blank") Do Until objIE.readyState = 4 Wscript.Sleep 100 Loop intWidth = objIE.document.ParentWindow.Screen.AvailWidth intHeight = objIE.document.ParentWindow.Screen.AvailHeight intWidthW = objIE.document.ParentWindow.Screen.AvailWidth * .60 intHeightW = objIE.document.ParentWindow.Screen.AvailHeight * .35 objIE.document.ParentWindow.resizeto intWidthW, intHeightW objIE.document.ParentWindow.moveto (intWidth - intWidthW)/2, (intHeight - intHeightW)/2 objIE.document.Write "<body> " & strMsg & " </body></html>" objIE.document.ParentWindow.document.body.style.backgroundcolor = "LightBlue" objIE.document.ParentWindow.document.body.scroll="no" objIE.document.ParentWindow.document.body.style.Font = "10pt 'Courier New'" objIE.document.ParentWindow.document.body.style.borderStyle = "outset" objIE.document.ParentWindow.document.body.style.borderWidth = "4px" objIE.document.Title = strIETitle objIE.Visible = True Wscript.Sleep 100 objShell.AppActivate strIETitle End Sub
Are you fucking retarded? Did you even read the post? But back on track, http://www.cloudcomputingleaders.com/ looks like it uses a twitter feed to update the site.
v4vikaskatoch: I do not know how come you posted something which is not even remotely related to the subject I raised. almondj: Thank You. Yea, Its a feed from twitter but strangely never saw this script anywhere yest And this site seems to be ranking quite well. I do not know what google see in it.