Performance Counters - Access Denied??

Discussion in 'ASP .Net Security' started by chortler@fetchmail.co.uk, May 10, 2005.

  1. Guest

    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
     
    , May 10, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Erik Cruz

    .NET Clr Data performance counters

    Erik Cruz, Oct 27, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    2,276
    Erik Cruz
    Oct 27, 2003
  2. Michael Carr
    Replies:
    0
    Views:
    585
    Michael Carr
    Jan 9, 2004
  3. Michael Carr
    Replies:
    4
    Views:
    2,565
    John Soulis [MSFT]
    Jan 12, 2004
  4. Dmitry Duginov

    Performance counters

    Dmitry Duginov, Dec 1, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    753
    Steven Cheng[MSFT]
    Dec 7, 2004
  5. Brian Newtz
    Replies:
    0
    Views:
    574
    Brian Newtz
    Dec 13, 2004
Loading...

Share This Page