Problems getting counter on on remote machine in Intranet using System.Diagnostics...

F

Frank Rosario

Hello all; in need of some assistance. I am currently writing some
software for our companies intranet, and I need for it to specifically
access other machines on the network's Performance counters. Now I ran
all the code against my machine and I can access the counter
information fine. But if I try to create a counter on a remote machine
I get an access denied error; obviously a permissions based issue. Now
I tried setting the assemblies to full trust; but I still can't access
the other intranet computer's counter. So what do I need to do with
the permissions so I can access counters on other computers in my
local intranet?

Relevant code snippet :

Class Computer
Public Sub New(ByVal ComputerName As String)
MachineName = ComputerName

'Breaks on this line if machineName isn't app host
cpuCounter = New PerformanceCounter("Processor", "% Processor
Time", "_Total", MachineName)
cDiskCounter = New PerformanceCounter("LogicalDisk", "Free
Megabytes", "C:", MachineName)
dDiskCounter = New PerformanceCounter("LogicalDisk", "Free
Megabytes", "D:", MachineName)
eDiskCounter = New PerformanceCounter("LogicalDisk", "Free
Megabytes", "E:", MachineName)
End Sub
End Class

If machineName is set to my computer's name, I'm fine. Any other
computer name; access denied.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top