Using Resource Explorer from the Command Line

Usually, you run Resource Explorer from the SMS 2003 Administrator console. You can also run it from the command line by specifying one of the following:

  • An explicit resource using the resource identifier

  • A query that returns a resource

When using Resource Explorer from the command line, you might also need to specify a collection that the resource belongs to, for example, if the user does not have appropriate security credentials to access all resources, but has credentials for accessing specific collections.

Using Resource Explorer from the command line is frequently a faster way to view data than using the SMS Administrator console for occasional inventory data review.

On This Page

Specifying an Explicit Resource
Using a Query to Specify a Resource
Using a Collection

Specifying an Explicit Resource

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

mmc explore.msc -s -sms:ResourceID=n -sms:Connection=<namespace path>

where:

  • n is the ResourceID of the SMS client that you want to display inventory for.

  • <namespace path> is the path to the Windows Management Instrumentation (WMI) namespace that contains the SMS client data.

For example, the following command displays inventory data for the client associated with ResourceID=1:

mmc c:\sms\bin\i386\explore.msc -s -sms:ResourceID=1 -sms:Connection=\\<MyServer>\root\sms\<_ SMS_site code>

Using a Query to Specify a Resource

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

mmc explore.msc -s -sms:ResExplrQuery=<WQL Query> -sms:Connection=<namespace path>

where:

  • <WQL Query> is a valid WMI Query Language (WQL) query that returns the ResourceID of the SMS client that you want to display inventory for.

  • <namespace path> is the path to the WMI namespace that contains the SMS client data.

For example, the following command opens Resource Explorer with inventory data for the client named "MyComputer" that belongs to the SMS site "ABC" having a primary site server named "MyServer":

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

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

Using a Collection

Using Resource Explorer from the command line enforces the same security as using Resource Explorer from the SMS Administrator console. If you do not have Read Resource collections class rights to view the resource, you must specify a collection that grants you the proper credentials to view the resource.

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

mmc explore.msc -s -sms:CollectionID=<Collection ID> -sms:ResourceID=n -sms:Connection=<_ namespace path>

-Or-

mmc explore.msc -s -sms:CollectionID=<Collection ID> -sms:ResExplrQuery=<WQL Query> -sms:_ Connection=<namespace path>

where:

  • <Collection ID> identifies the collection that the resource belongs to, such as SMS00001.

  • n is the ResourceID of the SMS client that you want to display inventory data for.

  • <namespace path> is the path to the WMI namespace that contains the SMS client data.

  • <WQL Query> is a valid WQL query that returns a ResourceID of the SMS client that you want to display inventory data for.

For More Information

Did you find this information useful? Please send your suggestions and comments about the documentation to smsdocs@microsoft.com.