1boredguy Posted August 22, 2006 Share Posted August 22, 2006 I'm not a coder, but would like to get this script running. I found it at informit.com. I get the gist of what's going on, but I keep getting this error.'get domain nameDim sDomainsDomain = InputBox("Enter domain to inventory")'connect to domain and retrieve'a list of member objectsDim oDomainSet oDomain = GetObject("WinNT://" & sDomain)'get the filesystemobjectDim oFSOSet oFSO = CreateObject("Scripting.FileSystemObject")'open an output fileDim oOutputSet oOutput = oFSO.CreateTextFile("output.txt")'run through the objectsDim oObject, sComputerName, sDetailsFor Each oObject In oDomain 'is this object a computer? If oObject.Class = "Computer" Then 'yes - get computer name sComputerName = oObject.Name 'get OS info sDetails = GetOSInfo(sComputerName) 'write info to the file oOutput.Write sDetails End IfNext'close the output fileoOutput.Close'release objectsSet oOutput = NothingSet oFSO = NothingSet oObject = nothingSet oDomain = Nothing'display completion messageWScript.Echo "Output saved"Function GetOSInfo(sComputer) 'declare variables Dim objWMIService Dim colItems Dim strOutput 'get WMI service Set objWMIService = GetObject("winmgmts:\\" & _ sComputer & "\root\cimv2") 'get item collection Set colItems = objWMIService.ExecQuery( _ "Select * from Win32_OperatingSystem",,48) 'init output string strOutput = String(70,"-") strOutput = strOutput & sComputer 'append info to output string For Each objItem in colItems strOutput = strOutput & "BuildNumber: " & _ objItem.BuildNumber & vbCrLf strOutput = strOutput & "BuildType: " & _ objItem.BuildType & vbCrLf strOutput = strOutput & "Caption: " & _ objItem.Caption & vbCrLf strOutput = strOutput & "EncryptionLevel: " & _ objItem.EncryptionLevel & vbCrLf strOutput = strOutput & "InstallDate: " & _ objItem.InstallDate & vbCrLf strOutput = strOutput & "Manufacturer: " & _ objItem.Manufacturer & vbCrLf strOutput = strOutput & "MaxNumberOfProcesses: " & _ objItem.MaxNumberOfProcesses & vbCrLf strOutput = strOutput & "MaxProcessMemorySize: " & _ objItem.MaxProcessMemorySize & vbCrLf strOutput = strOutput & "Name: " & _ objItem.Name & vbCrLf strOutput = strOutput & _ "NumberOfLicensedUsers: " & _ objItem.NumberOfLicensedUsers & vbCrLf strOutput = strOutput & "NumberOfProcesses: " & _ objItem.NumberOfProcesses & vbCrLf strOutput = strOutput & "NumberOfUsers: " & _ objItem.NumberOfUsers & vbCrLf strOutput = strOutput & "OSProductSuite: " & _ objItem.OSProductSuite & vbCrLf strOutput = strOutput & "OSType: " & _ objItem.OSType & vbCrLf strOutput = strOutput & "OtherTypeDescription: " & _ objItem.OtherTypeDescription & vbCrLf strOutput = strOutput & "Primary: " & _ objItem.Primary & vbCrLf strOutput = strOutput & "ProductType: " & _ objItem.ProductType & vbCrLf strOutput = strOutput & "RegisteredUser: " & _ objItem.RegisteredUser & vbCrLf strOutput = strOutput & "SerialNumber: " & _ objItem.SerialNumber & vbCrLf strOutput = strOutput & _ "ServicePackMajorVersion: " & _ objItem.ServicePackMajorVersion & vbCrLf strOutput = strOutput & _ "ServicePackMinorVersion: " & _ objItem.ServicePackMinorVersion & vbCrLf strOutput = strOutput & "Version: " & _ objItem.Version & vbCrLf strOutput = strOutput & "WindowsDirectory: " & _ objItem.WindowsDirectory & vbCrLf Next 'return results GetOSInfo = sOutputEnd FunctionThe error screen says to check line 56, which I do, but I don't get what's wrong.Please help. Thanks. Link to comment Share on other sites More sharing options...
CoffeeFiend Posted August 22, 2006 Share Posted August 22, 2006 (edited) . Edited November 7, 2006 by crahak Link to comment Share on other sites More sharing options...
1boredguy Posted August 22, 2006 Author Share Posted August 22, 2006 never mind. the scripts in the topic eyeball started work great.thanks for the reply. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now