0
我正在VBScript中運行WQL查詢以從我們的SCCM數據庫中提取數據。我可以做其他所有按預期工作的查詢。他們通常會返回一個對象的集合,我可以通過循環和訪問使用標準方法:WQL查詢返回集合中的多個實例
For Each objGroup in colGroups
wscript.echo objgroup.name
Next
使用的objgroup.GetObjectText_
方法在工作查詢對象的集合中的一個內顯示的數據時,我通常看到的東西像:
instance of SMS_R_UserGroup
{
Name = "whatevername";
UsergroupName = "whatever";
WindowsNTDomain = "whatever";
};
有本質上是一個單一實例(請糾正我,如果我的術語是錯誤的)與我可以很容易地訪問屬性的每個對象之內。
有問題的查詢,我看到每個對象中的多個實例:
instance of __GENERIC
{
SMS_G_System_NETWORK_ADAPTER_CONFIGURATION =
instance of SMS_G_System_NETWORK_ADAPTER_CONFIGURATION
{
DefaultIPGateway = "xxxx";
DHCPEnabled = 1;
DHCPServer = "xxxx";
DNSDomain = "xxxx";
DNSHostName = "xxxx";
GroupID = 4;
Index = 9;
IPAddress = "xxxxxx";
IPEnabled = 1;
IPSubnet = "xxxx";
MACAddress = "xxxx";
ResourceID = 74762;
RevisionID = 11;
ServiceName = "xxxxxx";
TimeStamp = "xxxxx";
};
SMS_R_System =
instance of SMS_R_System
{
Active = 1;
ADSiteName = "xxxxxx";
AgentName = {"xxxxxx"};
AgentSite = {"xxxxx"};
AgentTime = {"xxxxxx"};
AlwaysInternet = 0;
Client = 1;
ClientType = 1;
ClientVersion = "xxxx";
};
如何訪問屬性中的對象有多個實例?爲什麼它返回多個實例?
順便說一句,這裏是我運行查詢:
SELECT *
FROM SMS_R_System
JOIN SMS_G_System_NETWORK_ADAPTER_CONFIGURATION ON
SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.ResourceID = SMS_R_System.ResourceID
WHERE SMS_R_System.Name = 'xxxxxx' AND
SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.IPAddress IS NOT NULL