asp page that query Exchange ldap attributes (Error 70 with External account)

Discussion in 'ASP General' started by ouistyty@gmail.com, Apr 23, 2007.

  1. Guest

    Hi We have a simple asp page that query LDAP attribrute.

    Everithing is working fine using a native domain account. but when
    using an external account we have an error 70, acces denie.


    Here's some basic info on our structure.
    - Domain/Forest A with Exchange
    - Domain/Forest B with external accounts.
    - Forest A Trus Forest B and "Vice Versa"
    - asp page on a Exchange FrontEnd server on default web site (same as
    Exchange)
    - asp page is using basic authentification.
    - Authentification work fine using native domain account or External
    domain Account.
    - Getting native Windows attributes work fine with External account
    but the attributes starting with "ms-Exch" do not come out.(Exchange
    Attribute).


    Here is the code I have. Maybe it's not optimise but it's feel free
    to
    argue about it.


    ###########################################################################­
    #############


    <html>
    <head>
    <title>Boites mail over Quota</title>
    </head>


    <body>
    <%
    On Error Resume Next
    Dim cComputerName


    cComputerName = "server.domainA.com"


    Const cWMINameSpace = "root/MicrosoftExchangeV2"
    Const cWMIInstance = "Exchange_Mailbox"


    Dim sWinMgmts ' Connection string for WMI
    Dim oWMIExchange ' Exchange Namespace WMI object
    Dim lExchange_Mailboxes ' ExchangeLogons collection
    Dim oExchange_Mailbox ' A single ExchangeLogon WMI object


    'Write a heading into the output file
    'oOutputFile.writeline("Nom BAL;Taille (KB);Nombre
    d'elements;Statut")
    Response.Write "<table border=""1""><tr
    bgcolor=""#99CCFF""><td><b><center>Nom BAL</center></b></
    td><td><b><center>Taille (KB)</center></b></td><td><b><center>Nombre
    d'elements</center></b></td><td><b><center>Statut</center></b></td>"


    ' Create the object string, indicating WMI (winmgmts), using the
    ' current user credentials (impersonationLevel=impersonate),
    ' on the computer specified in the constant cComputerName, and
    ' using the CIM namespace for the Exchange provider.
    sWinMgmts = "winmgmts:{impersonationLevel=impersonate}!//"& _
    cComputerName&"/"&cWMINameSpace
    Set oWMIExchange = GetObject(sWinMgmts)


    ' Verify we were able to correctly set the object.
    If Err.Number <> 0 Then
    'oOutputFile.writeline("Error: " & err.number & ", " &
    err.description)
    Response.Write "<br>" & "Erreur : " & err.number & ", " &
    err.description
    Else
    ' The Resources that currently exist appear as a list of
    ' Exchange_Mailbox instances in the Exchange namespace.
    Set lExchange_Mailboxes =
    oWMIExchange.InstancesOf(cWMIInstance)


    ' Were any Exchange_Mailbox Instances returned?
    If (lExchange_Mailboxes.count > 0) Then
    ' If yes, do the following:
    ' Iterate through the list of Exchange_Mailbox
    objects.
    For Each oExchange_Mailbox in lExchange_Mailboxes
    Select Case
    oExchange_Mailbox.StorageLimitInfo
    Case 2
    Response.Write "<tr
    bgcolor=""#FFFF33""><td>" &
    oExchange_Mailbox.MailboxDisplayName & "</td><td>" &
    oExchange_Mailbox.Size & "</td><td>" & oExchange_Mailbox.TotalItems &
    "</td><td>" & oExchange_Mailbox.StorageLimitInfo & "</td>"
    Case 4
    Response.Write "<tr
    bgcolor=""#FF0000""><td>" &
    oExchange_Mailbox.MailboxDisplayName & "</td><td>" &
    oExchange_Mailbox.Size & "</td><td>" & oExchange_Mailbox.TotalItems &
    "</td><td>" & oExchange_Mailbox.StorageLimitInfo & "</td>"
    End Select
    Next
    Response.Write "</table>"
    Else
    ' If no Exchange_Mailbox instances were returned,
    ' display that.
    Response.Write "WARNING: No Exchange_Mailbox instances
    were
    returned."
    End If
    End If
    %>
    </body>
    </html>


    ################################## End of Code
    #############################################"


    If you think I should post on other newsgroup, please let me know
    witch one.


    Best regards.


    Christian
    , Apr 23, 2007
    #1
    1. Advertising

  2. Guest

    On 23 avr, 16:59, wrote:
    > Hi We have a simple asp page that query LDAP attribrute.
    >
    > Everithing is working fine using a native domain account. but when
    > using an external account we have an error 70, acces denie.
    >
    > Here's some basic info on our structure.
    > - Domain/Forest A with Exchange
    > - Domain/Forest B with external accounts.
    > - Forest A Trus Forest B and "Vice Versa"
    > - asp page on a Exchange FrontEnd server on default web site (same as
    > Exchange)
    > - asp page is using basic authentification.
    > - Authentification work fine using native domain account or External
    > domain Account.
    > - Getting native Windows attributes work fine with External account
    > but the attributes starting with "ms-Exch" do not come out.(Exchange
    > Attribute).
    >
    > Here is the code I have. Maybe it's not optimise but it's feel free
    > to
    > argue about it.
    >
    > ###########################################################################­­
    > #############
    >
    > <html>
    > <head>
    > <title>Boites mail over Quota</title>
    > </head>
    >
    > <body>
    > <%
    > On Error Resume Next
    > Dim cComputerName
    >
    > cComputerName = "server.domainA.com"
    >
    > Const cWMINameSpace = "root/MicrosoftExchangeV2"
    > Const cWMIInstance = "Exchange_Mailbox"
    >
    > Dim sWinMgmts ' Connection string for WMI
    > Dim oWMIExchange ' Exchange Namespace WMI object
    > Dim lExchange_Mailboxes ' ExchangeLogons collection
    > Dim oExchange_Mailbox ' A single ExchangeLogon WMI object
    >
    > 'Write a heading into the output file
    > 'oOutputFile.writeline("Nom BAL;Taille (KB);Nombre
    > d'elements;Statut")
    > Response.Write "<table border=""1""><tr
    > bgcolor=""#99CCFF""><td><b><center>Nom BAL</center></b></
    > td><td><b><center>Taille (KB)</center></b></td><td><b><center>Nombre
    > d'elements</center></b></td><td><b><center>Statut</center></b></td>"
    >
    > ' Create the object string, indicating WMI (winmgmts), using the
    > ' current user credentials (impersonationLevel=impersonate),
    > ' on the computer specified in the constant cComputerName, and
    > ' using the CIM namespace for the Exchange provider.
    > sWinMgmts = "winmgmts:{impersonationLevel=impersonate}!//"& _
    > cComputerName&"/"&cWMINameSpace
    > Set oWMIExchange = GetObject(sWinMgmts)
    >
    > ' Verify we were able to correctly set the object.
    > If Err.Number <> 0 Then
    > 'oOutputFile.writeline("Error: " & err.number & ", " &
    > err.description)
    > Response.Write "<br>" & "Erreur : " & err.number & ", " &
    > err.description
    > Else
    > ' The Resources that currently exist appear as a list of
    > ' Exchange_Mailbox instances in the Exchange namespace.
    > Set lExchange_Mailboxes =
    > oWMIExchange.InstancesOf(cWMIInstance)
    >
    > ' Were any Exchange_Mailbox Instances returned?
    > If (lExchange_Mailboxes.count > 0) Then
    > ' If yes, do the following:
    > ' Iterate through the list of Exchange_Mailbox
    > objects.
    > For Each oExchange_Mailbox in lExchange_Mailboxes
    > Select Case
    > oExchange_Mailbox.StorageLimitInfo
    > Case 2
    > Response.Write "<tr
    > bgcolor=""#FFFF33""><td>" &
    > oExchange_Mailbox.MailboxDisplayName & "</td><td>" &
    > oExchange_Mailbox.Size & "</td><td>" & oExchange_Mailbox.TotalItems &
    > "</td><td>" & oExchange_Mailbox.StorageLimitInfo & "</td>"
    > Case 4
    > Response.Write "<tr
    > bgcolor=""#FF0000""><td>" &
    > oExchange_Mailbox.MailboxDisplayName & "</td><td>" &
    > oExchange_Mailbox.Size & "</td><td>" & oExchange_Mailbox.TotalItems &
    > "</td><td>" & oExchange_Mailbox.StorageLimitInfo & "</td>"
    > End Select
    > Next
    > Response.Write "</table>"
    > Else
    > ' If no Exchange_Mailbox instances were returned,
    > ' display that.
    > Response.Write "WARNING: No Exchange_Mailbox instances
    > were
    > returned."
    > End If
    > End If
    > %>
    > </body>
    > </html>
    >
    > ################################## End of Code
    > #############################################"
    >
    > If you think I should post on other newsgroup, please let me know
    > witch one.
    >
    > Best regards.
    >
    > Christian


    up.
    No one can help me ?
    Regards.
    Christian
    , Apr 25, 2007
    #2
    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. =?Utf-8?B?R3JpZ3M=?=

    Read Inbox from another Exchange account

    =?Utf-8?B?R3JpZ3M=?=, Apr 27, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    569
    =?Utf-8?B?R3JpZ3M=?=
    Apr 27, 2005
  2. www.westerncartooncards.ca

    Exchange Links < Western Cartoon Cards > Exchange Links

    www.westerncartooncards.ca, Jul 12, 2004, in forum: HTML
    Replies:
    2
    Views:
    1,238
    Toby Inkster
    Jul 12, 2004
  3. Replies:
    1
    Views:
    399
    Cowboy \(Gregory A. Beamer\)
    Apr 23, 2007
  4. nilapenn
    Replies:
    3
    Views:
    625
    Joe Kaplan \(MVP - ADSI\)
    Feb 14, 2005
  5. Alessandro Barracco

    matrix: exchange rows + exchange columns

    Alessandro Barracco, Jan 25, 2011, in forum: Ruby
    Replies:
    0
    Views:
    157
    Alessandro Barracco
    Jan 25, 2011
Loading...

Share This Page