This script works great except it keeps the service tag for the next line from the previous workstation. How do I clear the vaule?
Code:
On Error Resume Next
Const ForAppending = 8
Set oFSO = CreateObject("Scripting.FileSystemObject")
set WSHShell = wscript.createObject("wscript.shell")
Set oTextStream = oFSO.OpenTextFile("\\Path\wslist.txt")
RemotePC = Split(oTextStream.ReadAll, vbNewLine)
oTextStream.Close
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("\\path\ScriptLog.txt", ForAppending, True)
For Each strComputer In RemotePC
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colBIOS = objWMIService.ExecQuery("Select * from Win32_BIOS")
For each objBIOS in colBIOS
objFile.WriteLine strComputer & "," & objBIOS.Manufacturer & "," & objBIOS.SerialNumber
Next
Next
objFile.Close