Class CompSys Dim colItems,objItem,item Dim yr,mo,dy,tm Dim strProperty,strClass,objWMIService,SWBemLocator Public Function ConnectServer(strComputer,Username,Password) Const WbemPrivilegeSecurity=7 Const WbemAuthenticationLevelPktPrivacy=6 Const ReturnImmediately=&h10 Const ForwardOnly=&h20 Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator") SWBemlocator.Security_.ImpersonationLevel=3 SWBemlocator.Security_.AuthenticationLevel= _ WbemAuthenticationLevelPktPrivacy Set objWMIService = SWBemlocator.ConnectServer(strComputer, _ "root\CIMV2",UserName,Password) End Function Private Function GetData(strProperty,strClass) Const WbemPrivilegeSecurity=7 Const WbemAuthenticationLevelPktPrivacy=6 Const ReturnImmediately=&h10 Const ForwardOnly=&h20 strQuery="Select " & strProperty & " from " & strClass Set colItems = objWMIService.ExecQuery(strQuery,"WQL", _ ForwardOnly+ReturnImmediately) For Each objItem in colItems For Each item In objItem.Properties_ 'WScript.Echo item.name & vbTab & item.value If InStr(1,item.name,strProperty,vbBinarycompare) _ Then strReturn=item.value Next Next GetData=strReturn End Function Public Property Get Model Model=GetData("Model","win32_Computersystem") End Property 'additional class definitions go here End Class