473,805 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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 authentificatio n.
- Authentificatio n 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/MicrosoftExchan geV2"
Const cWMIInstance = "Exchange_Mailb ox"

Dim sWinMgmts ' Connection string for WMI
Dim oWMIExchange ' Exchange Namespace WMI object
Dim lExchange_Mailb oxes ' ExchangeLogons collection
Dim oExchange_Mailb ox ' A single ExchangeLogon WMI object

'Write a heading into the output file
'oOutputFile.wr iteline("Nom BAL;Taille (KB);Nombre d'elements;Stat ut")
Response.Write "<table border=""1""><t r
bgcolor=""#99CC FF""><td><b><ce nter>Nom BAL</center></b></
td><td><b><cent er>Taille (KB)</center></b></td><td><b><cent er>Nombre
d'elements</center></b></td><td><b><cent er>Statut</center></b></td>"

' Create the object string, indicating WMI (winmgmts), using the
' current user credentials (impersonationL evel=impersonat e),
' on the computer specified in the constant cComputerName, and
' using the CIM namespace for the Exchange provider.
sWinMgmts = "winmgmts:{impe rsonationLevel= impersonate}!//"& _
cComputerName&"/"&cWMINameS pace
Set oWMIExchange = GetObject(sWinM gmts)

' Verify we were able to correctly set the object.
If Err.Number <0 Then
'oOutputFile.wr iteline("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_Mailbo x instances in the Exchange namespace.
Set lExchange_Mailb oxes = oWMIExchange.In stancesOf(cWMII nstance)

' Were any Exchange_Mailbo x Instances returned?
If (lExchange_Mail boxes.count 0) Then
' If yes, do the following:
' Iterate through the list of Exchange_Mailbo x objects.
For Each oExchange_Mailb ox in lExchange_Mailb oxes
Select Case oExchange_Mailb ox.StorageLimit Info
Case 2
Response.Write "<tr bgcolor=""#FFFF 33""><td>" &
oExchange_Mailb ox.MailboxDispl ayName & "</td><td>" &
oExchange_Mailb ox.Size & "</td><td>" & oExchange_Mailb ox.TotalItems &
"</td><td>" & oExchange_Mailb ox.StorageLimit Info & "</td>"
Case 4
Response.Write "<tr bgcolor=""#FF00 00""><td>" &
oExchange_Mailb ox.MailboxDispl ayName & "</td><td>" &
oExchange_Mailb ox.Size & "</td><td>" & oExchange_Mailb ox.TotalItems &
"</td><td>" & oExchange_Mailb ox.StorageLimit Info & "</td>"
End Select
Next
Response.Write "</table>"
Else
' If no Exchange_Mailbo x instances were returned,
' display that.
Response.Write "WARNING: No Exchange_Mailbo x 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 '07 #1
1 1947
The best group to publish to is:
microsoft.publi c.inetserver.as p.general

This group is an ASP.NET group and you may not get an answer.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************** *************** ***************
Think outside the box!
*************** *************** ***************
<ou******@gmail .comwrote in message
news:11******** *************@n 59g2000hsh.goog legroups.com...
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 authentificatio n.
- Authentificatio n 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/MicrosoftExchan geV2"
Const cWMIInstance = "Exchange_Mailb ox"

Dim sWinMgmts ' Connection string for WMI
Dim oWMIExchange ' Exchange Namespace WMI object
Dim lExchange_Mailb oxes ' ExchangeLogons collection
Dim oExchange_Mailb ox ' A single ExchangeLogon WMI object

'Write a heading into the output file
'oOutputFile.wr iteline("Nom BAL;Taille (KB);Nombre d'elements;Stat ut")
Response.Write "<table border=""1""><t r
bgcolor=""#99CC FF""><td><b><ce nter>Nom BAL</center></b></
td><td><b><cent er>Taille (KB)</center></b></td><td><b><cent er>Nombre
d'elements</center></b></td><td><b><cent er>Statut</center></b></td>"

' Create the object string, indicating WMI (winmgmts), using the
' current user credentials (impersonationL evel=impersonat e),
' on the computer specified in the constant cComputerName, and
' using the CIM namespace for the Exchange provider.
sWinMgmts = "winmgmts:{impe rsonationLevel= impersonate}!//"& _
cComputerName&"/"&cWMINameS pace
Set oWMIExchange = GetObject(sWinM gmts)

' Verify we were able to correctly set the object.
If Err.Number <0 Then
'oOutputFile.wr iteline("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_Mailbo x instances in the Exchange namespace.
Set lExchange_Mailb oxes = oWMIExchange.In stancesOf(cWMII nstance)

' Were any Exchange_Mailbo x Instances returned?
If (lExchange_Mail boxes.count 0) Then
' If yes, do the following:
' Iterate through the list of Exchange_Mailbo x objects.
For Each oExchange_Mailb ox in lExchange_Mailb oxes
Select Case oExchange_Mailb ox.StorageLimit Info
Case 2
Response.Write "<tr bgcolor=""#FFFF 33""><td>" &
oExchange_Mailb ox.MailboxDispl ayName & "</td><td>" &
oExchange_Mailb ox.Size & "</td><td>" & oExchange_Mailb ox.TotalItems &
"</td><td>" & oExchange_Mailb ox.StorageLimit Info & "</td>"
Case 4
Response.Write "<tr bgcolor=""#FF00 00""><td>" &
oExchange_Mailb ox.MailboxDispl ayName & "</td><td>" &
oExchange_Mailb ox.Size & "</td><td>" & oExchange_Mailb ox.TotalItems &
"</td><td>" & oExchange_Mailb ox.StorageLimit Info & "</td>"
End Select
Next
Response.Write "</table>"
Else
' If no Exchange_Mailbo x instances were returned,
' display that.
Response.Write "WARNING: No Exchange_Mailbo x 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 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1573
by: krushn | last post by:
My objective is to get the GAL data from Exchange server 5.5 using ASP.net page or asp page. Its a asp.net application. Environment details: Exchange server version: 5.5 LDAP: supports LDAP Active Directory: does not support active directory I tried the below methods with no success Method 1:
2
4753
by: Vincent Nguyen | last post by:
Hi, I have problem create exchange 2000 mailbox using CDOEXM in my Web Service application. The error I got was "Catastrophic failure". Here is the code that I have: DirectoryEntry user = new DirectoryEntry("LDAP://fmsamrmc001.amrmc.minicorp.intel.com/"+strDN); user.Properties.Value = "aaamailbox1"; user.CommitChanges();
5
1522
by: Tim::.. | last post by:
Hi can someone please tell me how I change this directory service query so that it searches through each record in the active directory and returns all the accounts! At the moment I can only get the query to return one account at a time! I presume I have to create some kind of loop on the following so I return all the users SAM info???? Dim SamAccount As String = Right(inSAM, Len(inSAM) - InStr(inSAM, "\"))
0
1043
by: Leon | last post by:
I keep geting this error in the IE when trying to run the scrept below from an ASP page. Can any one help please. Error Type: Provider (0x80040E37) Table does not exist. /gal.asp, line 43
3
3279
by: Robert Iver | last post by:
Hello, I am developing an application in C# using VS .NET 2005 that will be accessing and updating Active Directory via LDAP. So, far I have written the main portions, but now I am stuck on the code to CHANGE and ADD/DELETE entries. I'm pretty sure my problem is security related, but I can't quite narrow it down. I bind to the root of the AD domain using an account that is a Domain Admin on the AD server itself, HOWEVER....
1
2748
by: ouistyty | last post by:
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"
1
4971
by: Magnus R | last post by:
In VB.Net I'm trying to find out the names of what Administrative Groups exist by querying Active Directory. The problem is when I try and query the children of the key LDAP://CN=Administrative Groups, CN=ExchOrg, CN=Microsoft Exchange, CN=Services, CN=Configuration, CN=domain, CN=com I don't get anything except an error that the "Object doesn't exist on the server." However when I bind to this LDAP path using LDP.exe I can see the...
0
1735
by: rage2001 | last post by:
I have a script (ASP) written which creates an account in AD, creates a folder on our file server and sets its permissions, and then creates a mailbox on the exchange server and sets its permissions... This script use to work fine, and it hasnt been used in 2 months (since we have had no new students since the end of the term). I have part of the script below. There is alot of code above this script which gets executed perfectly....
0
3237
by: rbukkara | last post by:
Hi, I have got the following error while trying to add a user in the LDAP Directory. javax.naming.NameNotFoundException: ; remaining name 'uid=vassila,ou=People,dc=cs,dc=uno,dc=edu' I have given all the attributes which are needed, for the user, in the code and also the proper path where the user has to be added. Please have a look at my code CODE] // This is a class file which stores all the info required for the user
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10609
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10360
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10105
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9185
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4323
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.