WMI Script help
- From: "Ann Thomas" <anne_27@xxxxxxxxxxx>
- Date: 2 Jan 2007 07:37:21 -0800
Hello
I am attempting a script that will read GUIDs from a log file and
connect to the SMS namespace and write the ResourceID based on the
client GUID to a text file
Here is what the script looks like - logstr1.txt is the file that has
the GUID -one on each line. I can't get this to work .. would
appreciate any ideas or suggestions.
On Error Resume Next
Set loc = CreateObject("WbemScripting.SWbemLocator")
Set WbemServices = loc.ConnectServer( , "root\SMS\site_CEN")
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("D:\temp\logstr1.txt")
Do Until objFile.AtEndOfStream
GUIDID= "GUID:" + objFile.ReadLine
ResourceNo=objSWbemServices.ExecQuery ("SELECT ResourceID FROM
SMS_R_System WHERE SMSUniqueIdentifier="'" & GUIDID & "'" ")
Wscript.Echo ResourceNo
Loop
.
- Follow-Ups:
- Re: WMI Script help
- From: Todd Vargo
- Re: WMI Script help
- From: TDM
- Re: WMI Script help
- Prev by Date: Re: Return a value from a log file
- Next by Date: Re: WMI Script help
- Previous by thread: Re: Where to download Microsoft's "Scriptlet Wizard"
- Next by thread: Re: WMI Script help
- Index(es):
Relevant Pages
|