Re: Performance Counters - Access Denied??
From: Alvin Bruney [MVP - ASP.NET] (www.lulu.com/owc)
Date: 05/12/05
- Next message: dl: "Re: form authetication?"
- Previous message: Joe Kaplan \(MVP - ADSI\): "Re: form authetication?"
- In reply to: chortler_at_fetchmail.co.uk: "Performance Counters - Access Denied??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 11 May 2005 18:27:46 -0400
Perf counters run as COM calls, you need to add the appropriate permissions
to the COM process. One quick way to test this is to bump the process up to
system in the machine config files. Once the call to perf counters works,
figure out exactly what permissions to add and change the account back down
to what it was in the machine config file. It's very dangerous to leave the
account running under system
--
Regards,
Alvin Bruney - ASP.NET MVP
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
<chortler@fetchmail.co.uk> wrote in message
news:1115718097.145092.310050@o13g2000cwo.googlegroups.com...
> When I try the following piece of code, using a administrator's
> account, I get an error of access denied. Getting the counters for the
> local machine works fine. Any ideas??
>
>
> WEB.CONFIG
> identity impersonate="true" userName="DOMAIN\admin" password="xyz"/>
>
>
>
> Public Class Class1
> Dim perfFreeMem As New PerformanceCounter("Memory", "Available
> MBytes")
> Dim perfServSess As New PerformanceCounter("Server", "Server
> Sessions")
>
> Sub New(ByVal sServername As String)
> perfFreeMem.MachineName = sServername
> perfServSess.MachineName = sServername
> End Sub
>
> Public ReadOnly Property GetValue() As String
> Get
> On Error GoTo Err_Handler
> Dim sTmp As String
> sTmp = perfFreeMem.NextValue & " " & perfServSess.NextValue
> Return sTmp
> Err_Handler:
> sTmp = "- " & Err.Description()
> Return sTmp
> End Get
> End Property
> End Class
>
- Next message: dl: "Re: form authetication?"
- Previous message: Joe Kaplan \(MVP - ADSI\): "Re: form authetication?"
- In reply to: chortler_at_fetchmail.co.uk: "Performance Counters - Access Denied??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]