Share via


WmiClassToInventoryReportInstance.WmiClassToInventoryInstances Method (String, String, String, String, String, String, String)

 

Connects to WMI on a remote machine with the specified credentials and gets the WMI instances from a class.

You can overwrite the WMI class by using spoofWmiClass. This is useful when the client isn't installed.

Namespace:   Microsoft.ConfigurationManagement.Messaging.Messages
Assembly:  Microsoft.ConfigurationManagement.Messaging (in Microsoft.ConfigurationManagement.Messaging.dll)

Syntax

public static InventoryInstance[] WmiClassToInventoryInstances(
    string hostName,
    string scope,
    string wmiClass,
    string spoofWmiClass,
    string spoofNamespace,
    string userName,
    string password
)
public:
static array<InventoryInstance^>^ WmiClassToInventoryInstances(
    String^ hostName,
    String^ scope,
    String^ wmiClass,
    String^ spoofWmiClass,
    String^ spoofNamespace,
    String^ userName,
    String^ password
)
Public Shared Function WmiClassToInventoryInstances (
    hostName As String,
    scope As String,
    wmiClass As String,
    spoofWmiClass As String,
    spoofNamespace As String,
    userName As String,
    password As String
) As InventoryInstance()

Parameters

  • hostName
    Type: System.String

    The name of the host to connect to. If this value is null, localhost is used.

  • scope
    Type: System.String

    The namespace to connect to. This value is required.

  • wmiClass
    Type: System.String

    The WMI class. This value is required.

  • spoofWmiClass
    Type: System.String

    Overrides the WMI class in the inventory with this value. If this value is not defined, the value for wmiClass is used.

  • spoofNamespace
    Type: System.String

    Overrides the WMI namespace in the inventory with this value. If this value is not defined, the value for scope is used.

  • password
    Type: System.String

    The password for the user provided in userName.

Return Value

Type: Microsoft.ConfigurationManagement.Messaging.Messages.InventoryInstance[]

See Also

WmiClassToInventoryInstances Overload
WmiClassToInventoryReportInstance Class
Microsoft.ConfigurationManagement.Messaging.Messages Namespace

Return to top