By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,948 Members | 1,595 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,948 IT Pros & Developers. It's quick & easy.

Accessing performance counters on remote machines ...

P: n/a
Don
Hello!

I am trying to write some code to access performance counters on a
remote machine. Ideally, I would like to add a machine to a tree
control (like the "Servers" view in the .NET IDE) and prompt the user
to put in a username/password for that machine. I'm not too familiar
with the security model involved here, and was hoping someone either
has come across this before or could point me in the right direction.

Thanks in advance!
Don
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Don,

You can specify which performance counter you want to attach to on which
machine you want through the constructor. There is an overload which takes
a machine name.

If you want to impersonate another user, then you might want to look at
the Impersonate method on the WindowsIdentity class. The documentation for
that method shows how to use it in conjunction with a call to the LogonUser
API to impersonate another user. You will need to do this if you want to
access performance counters on another machine as another user.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Don" <do*******@yahoo.com> wrote in message
news:e7**************************@posting.google.c om...
Hello!

I am trying to write some code to access performance counters on a
remote machine. Ideally, I would like to add a machine to a tree
control (like the "Servers" view in the .NET IDE) and prompt the user
to put in a username/password for that machine. I'm not too familiar
with the security model involved here, and was hoping someone either
has come across this before or could point me in the right direction.

Thanks in advance!
Don

Nov 16 '05 #2

P: n/a
If you wanna authenticate the user requesting the counters and they have
rights to the counters on the remote network machine, take a look at WMI.
Very easy to implement ... Another alternative is to use the
System.Diagnostics namespace but unless there is a mapped drive (or cached
connection) access will be denied. An additional alternative is publish the
counters to a remoting object and read from there but it is not a very
robust way to handle this problem.

Alex

"Don" <do*******@yahoo.com> wrote in message
news:e7**************************@posting.google.c om...
Hello!

I am trying to write some code to access performance counters on a
remote machine. Ideally, I would like to add a machine to a tree
control (like the "Servers" view in the .NET IDE) and prompt the user
to put in a username/password for that machine. I'm not too familiar
with the security model involved here, and was hoping someone either
has come across this before or could point me in the right direction.

Thanks in advance!
Don


Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.