sonnyblack219
Goto Top

Dell Service-Tags Remote per Script auslesen

Hallo ihr,
habe mit einem Kollegen zusammen ein Script gebastelt, was bei uns Inhouse super funktioniert - jedoch beim Kunden nicht. Vielleicht findet ihr einen Fehler....

Das Script wird über die CMD als Domänenadmin ausgeführt:

On Error Resume Next
set objFSO = CreateObject("Scripting.FileSystemObject")  
strInputFile = inputBox("Where is the file containing the computer names?",vbOkOnly+vbInformation,"C:\temp\computers.txt")  
set objInputFile = objFSO.OpenTextFile(strInputFile)
set objOutputFile = objFSO.CreateTextFile("d:\kunden\****\service tag\results.txt")  
allComputers = objInputFile.ReadAll()
arrComputers = split(allComputers, vbCrLf)

For Each strComputer in arrComputers
objOutputFile.WriteLine strComputer
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")  
Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS",,48)  
For Each objItem in colItems
objOutputFile.WriteLine vbTab & objItem.SerialNumber
Next
set colItems2 = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)  
For Each objItem2 in colItems2
objOutputFile.WriteLine vbTab & objItem2.UserName
objOutputFile.WriteLine vbTab & objItem2.Model & vbCrLf
Next
Next

msgBox "Script finished. Results can be found at C:\temp\results.txt",vbOkOnly+vbInformation,"Finished"   

Danke vorab!

Content-Key: 139033

Url: https://administrator.de/contentid/139033

Ausgedruckt am: 28.03.2024 um 16:03 Uhr

Mitglied: 76109
76109 24.03.2010 um 15:20:00 Uhr
Goto Top
Hallo SonnyBlack219!

Es wäre zunächst erstmal sinnvoll, das On Error mit einem Kommentarzeichen zu versehen, um eventuell eine entsprechende Fehlermeldung zu bekommen?

Mein erster Verdacht wäre, das der Ordner-Pfad in Codezeile 5 noch nicht existiert?

Gruß Dieter
Mitglied: SonnyBlack219
SonnyBlack219 24.03.2010 um 15:38:00 Uhr
Goto Top
Hallo!

Das Verzeichnis war vorhanden, die Idee mit dem Kommentarzeichen probieren wir mal, danke face-smile