Reference Guide

'*** Retrieve the instance of DCIM_ControllerView class
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate," &_
"AuthenticationLevel=pktprivacy}\\" & strComputerName & "\" &_
strNameSpace)
'*** Set up the output file
set txtfile = fso.Createtextfile("RAID_Output.csv", true)
Set ColSystem=objWMIService.execquery ("Select * from " & strClassName)
outString = ""
For Each objItem in ColSystem
For Each p in objItem.Properties_
For Each obj in SupportedListCV
If p.Name = obj Then
' Display the values of the Name and Value properties of the SWbemProperty
object
outString = outString & p.Name & "," & p.Value & VbCrLf
End If
Next
Next
Next
txtfile.WriteLine outString
'*** Close the file
txtfile.close
'*** If any errors occurred, let the user know
If Err.Number <> 0 Then
WScript.Echo "Enabling Trusted Platform Module failed."
End If
'*** Sub used to display the correct usage of the script
Sub Usage()
Dim strMessage
strMessage = "incorrect syntax. You should run: " & vbCRLF & _
"cscript.exe /nologo SampleGetRAIDSettings.vbs <systemname>"
WScript.Echo strMessage
End Sub
'======================================================================
====
375