Platform SDK: Performance Monitoring |
By default, PDH functions access counters on the machine the PDH library is installed on. If you want to access counters located on another machine, call the PdhConnectMachine function with the name of that machine before accessing them. This establishes a connection to the specified machine for subsequent accesses of counters on that machine. You can call PdhConnectMachine many times to access counters on many machines.
The other way the access counters on remote machines is to specify the machine name in the counter path passed to a call to PdhAddCounter. For more information on adding counters with PdhAddCounter, refer to Adding Counters to a Query.