Share via


Running the Resource Explorer From the Command Line

The Resource Explorer is typically run from the SMS Administrator Console. However, you can run it from the command line by specifying the resource in one of the following ways:

  • Specifying an explicit resource using the resource identifier.
  • Specifying a query that returns a resource.
  • Specifying a collection to which the resource belongs.

Specifying an Explicit Resource

Use the following syntax to specify an explicit resource to display in the Resource Explorer.

mmc explore.msc -s -sms:ResourceID=n -sms:Connection=<namespace path>
  • where
    n
    ResourceID of the SMS client whose inventory data you want displayed.
  • <namespace path>
    Path to the database that contains the client data.

For example, the following command opens the Resource Explorer with inventory data for the client associated with ResourceID=1.

mmc explore.msc -s -sms:ResourceID=1 -sms:Connection=\\MyServer\root\sms\site_ABC

Using a Query to Specify a Resource

Use the following syntax to specify a query that returns a resource to display in the Resource Explorer.

mmc explore.msc -s -sms:ResExplrQuery=<WQL Query> -sms:Connection=<namespace path>
  • where
    <WQL Query>
    Valid WQL query that returns a ResourceID of the SMS client whose inventory data you want displayed.
  • <namespace path>
    Path to the database that contains the client data.

For example, the following command opens the Resource Explorer with inventory data for the client named MyComputer.

mmc explore.msc -s -sms:ResExplrQuery="SELECT ResourceID FROM SMS_R_SYSTEM WHERE Name = ""MyComputer""" -sms:connection=\\MyServer\root\sms\site_ABC

Note  Your query can return more than one instance, but the Resource Explorer only uses the first instance that is returned.

Using a Collection to Specify a Resource

Beginning with SMS version 2.0 Service Pack 1, you can specify the collection to which the resource belongs. This option is required if you do not have "Read Resource" class permissions for the secured object. You use the following syntax to specify the resource to display in the Resource Explorer.

mmc explore.msc -s -sms:CollectionID=<Collection ID> -sms:ResourceID=n -sms:Connection=<namespace path>
  • where
    <Collection ID>
    Identifies the collection to which the resource belongs, such as SMS00001.
  • n
    ResourceID of the SMS client whose inventory data you want displayed.
  • <namespace path>
    Path to the database that contains the client data.