kjohnson530
IS-IT--Management
I'm very new to working with XML and I'm trying to do a inventory of our physical assets without spending any money.
I came across a product from Microsoft called GPInventory which pull data about remote systems using wmi scripting I believe. Anyway the product offers the opportunity to store the results in an XML document which I'm hoping to use as a conduit to my SQL 2000 DB.
Below is my part of my xml doc, my schema file and my script to import it. Could someone explain to me what i'm doing wrong (WSH error code is 80004005)
XML--
Schema---
Script---
Any help would be greatly appreciated.
I came across a product from Microsoft called GPInventory which pull data about remote systems using wmi scripting I believe. Anyway the product offers the opportunity to store the results in an XML document which I'm hoping to use as a conduit to my SQL 2000 DB.
Below is my part of my xml doc, my schema file and my script to import it. Could someone explain to me what i'm doing wrong (WSH error code is 80004005)
XML--
Code:
<ComputerList>
<Computer Name="BENT-915" QueryState="Queried" Username="">
<ManagedObject Name="WMI: Logged on user" Query="select UserName from Win32_ComputerSystem">
<Instance>
<Attribute Name="UserName" Value="" />
</Instance>
</ManagedObject>
<ManagedObject Name="WMI: Processor Name" Query="select Name from Win32_Processor">
<Instance>
<Attribute Name="Name" Value=" Intel(R) Pentium(R) 4 CPU 1.80GHz" />
</Instance>
</ManagedObject>
<ManagedObject Name="WMI: Processor Speed" Query="select CurrentClockSpeed from Win32_Processor">
<Instance>
<Attribute Name="CurrentClockSpeed" Value="1794" />
</Instance>
</ManagedObject>
<ManagedObject Name="WMI: Computer Memory" Query="select TotalPhysicalMemory from Win32_ComputerSystem">
<Instance>
<Attribute Name="TotalPhysicalMemory" Value="670056448" />
</Instance>
</ManagedObject>
<ManagedObject Name="WMI: Computer Manufacturer" Query="select Manufacturer from Win32_ComputerSystem">
<Instance>
<Attribute Name="Manufacturer" Value="Dell Computer Corporation" />
</Instance>
</ManagedObject>
<ManagedObject Name="WMI: Computer Model" Query="select Model from Win32_ComputerSystem">
<Instance>
<Attribute Name="Model" Value="OptiPlex GX400 " />
</Instance>
</ManagedObject>
<ManagedObject Name="WMI: Display Adapter" Query="select Caption from Win32_DisplayConfiguration">
<Instance>
<Attribute Name="Caption" Value="16MB ATI Rage 128 Ultra" />
</Instance>
</ManagedObject>
</Computer>
</script>
Code:
<?xml version="1.0" ?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"
xmlns:sql="urn:schemas-microsoft-com:xml-sql" >
<ElementType name="UserName" dt:type="string" />
<ElementType name="Name" dt:type="string" />
<ElementType name="CurrentClockSpeed" dt:type="string" />
<ElementType name="TotalPhysicalMemory" dt:type="string" />
<ElementType name="Manufacturer" dt:type="string" />
<ElementType name="Model" dt:type="string" />
<ElementType name="Caption" dt:type="string" />
<ElementType name="ComputerList" sql:is-constant="1">
<element type="ManagedObject" />
</ElementType>
<ElementType name="ManagedObject" sql:relation="tblSystem">
<element type="UserName" sql:field="UserName" />
<element type="Name" sql:field="ProcName" />
<element type="CurrentClockSpeed" sql:field="ProcSpeed" />
<element type="TotalPhysicalMemory" sql:field="AmtMemory" />
<element type="Manufacturer" sql:field="builtby" />
<element type="Model" sql:field="Model" />
<element type="Caption" sql:field="VideoCard" />
</ElementType>
</Schema>
Code:
set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objBL.ConnectionString = "provider=SQLOLEDB.1;data source=Intranet;database=asset;uid=kjohnson;pwd=notrealpassword"
objBL.ErrorLogFile = "c:\error.log"
objBL.Execute "c:\map3.xml", "c:\Bent.xml"
set objBL=Nothing
Any help would be greatly appreciated.