473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Accessing AD using ADSI LDAP provider in ASP

I'd like to get some user account properties using .asp script. When I try
to use ADSI WINNT provider it works fine except that I apparently cannot
access some properties such as objUser.managedObjects. I have this simple
code:

<%
Set objUser = GetObject("LDAP://CN=Users,CN=FisrtName
LastName,DC=MyDomain,DC=com")
For Each strValue in objUser.managedObjects
Response.Write "This: " & strValue & "<br>"
Next
%>

As a VBS script it works fine but as an ASP page I cannot get the object
initialized. Is it problem with syntax or something else? I'd like to avoid
using .NET Framework and ADO connection as well if possible. All I really
need is to get list of managedObjects

Thank you,
Mar 10 '08 #1
3 5833
"TomikZ" <to********@s3group.comwrote in message
news:E8**********************************@microsof t.com...
I'd like to get some user account properties using .asp script. When I try
to use ADSI WINNT provider it works fine except that I apparently cannot
access some properties such as objUser.managedObjects. I have this simple
code:

<%
Set objUser = GetObject("LDAP://CN=Users,CN=FisrtName
LastName,DC=MyDomain,DC=com")
For Each strValue in objUser.managedObjects
Response.Write "This: " & strValue & "<br>"
Next
%>

As a VBS script it works fine but as an ASP page I cannot get the object
initialized. Is it problem with syntax or something else? I'd like to
avoid
using .NET Framework and ADO connection as well if possible. All I really
need is to get list of managedObjects
"I cannot get the object initialized" is hardly a good description of the
problem you are having. Could you be a bit more specific.

This will probably be a permission thing. The anonymous user guest account
may not have access to what you are trying to access.

Have you tried turning off anonymous access for the page and turning on
integrated security.

--
Anthony Jones - MVP ASP/ASP.NET
Mar 10 '08 #2
Anthony,
IE7.0 says "HTTP 500 Internal Server Error" and Firefox says error
'80072020' line 13 which is
Set objUser = GetObject("LDAP://CN=FirstName
LastName,CN=Users,DC=mydomain,DC=com")

When I try to catch the err value it's 424 but not when creating the objUser
but when trying to access it
Response.write objUser.FullName & "<br>"

Integrated Windows Authentication is the only one enabled and in the
Security log of the server I can see successfull logon via Kerberos with
some Priviliges granted. Also when I try to get LOGON_USER variable, it
contains my username and therefore I should have access to AD.

I don't know what could be wrong
Thank you,
Tomas

"Anthony Jones" <An*@yadayadayada.comwrote in message
news:uU**************@TK2MSFTNGP05.phx.gbl...
"TomikZ" <to********@s3group.comwrote in message
news:E8**********************************@microsof t.com...
>I'd like to get some user account properties using .asp script. When I
try
to use ADSI WINNT provider it works fine except that I apparently cannot
access some properties such as objUser.managedObjects. I have this simple
code:

<%
Set objUser = GetObject("LDAP://CN=Users,CN=FisrtName
LastName,DC=MyDomain,DC=com")
For Each strValue in objUser.managedObjects
Response.Write "This: " & strValue & "<br>"
Next
%>

As a VBS script it works fine but as an ASP page I cannot get the object
initialized. Is it problem with syntax or something else? I'd like to
avoid
>using .NET Framework and ADO connection as well if possible. All I really
need is to get list of managedObjects

"I cannot get the object initialized" is hardly a good description of the
problem you are having. Could you be a bit more specific.

This will probably be a permission thing. The anonymous user guest
account
may not have access to what you are trying to access.

Have you tried turning off anonymous access for the page and turning on
integrated security.

--
Anthony Jones - MVP ASP/ASP.NET

Mar 13 '08 #3
TomikZ wrote:
Anthony,
IE7.0 says "HTTP 500 Internal Server Error"
Are Friendly Errors turned off?
http://www.aspfaq.com/show.asp?id=2109

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 13 '08 #4

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

Similar topics

2
by: Christopher Johannsen | last post by:
Good Day: I am working on building a tool Using ASP/COM & IIS5.1 for a non-administrative technical support team to change domain passwords for users. I have the basic interface built and...
4
by: Brandon Arnold | last post by:
Hello All, I have a linked ADSI Server to our company Active Directory and everything is fine. I'm running queries and such using LDAP. BUT how can I aquire a list of attributes for the classes...
1
by: Prasad Karunakaran | last post by:
I am using the C# DirectoryEntry class to retrieve the Properties of an user object in the Active Directory. I need to get the First Name and Last Name as properties. I know it is not supported...
0
by: Tim | last post by:
Hello, I'm trying very (too) hard to log uses LDAP (via ADSI) to autheniticate users in an A2k2 application. We have AD and I have that working slick. We are in a tranistion from NDS to AD and...
1
by: Prasad Karunakaran | last post by:
I am using the C# DirectoryEntry class to retrieve the Properties of an user object in the Active Directory. I need to get the First Name and Last Name as properties. I know it is not supported...
10
by: Victor Pereira | last post by:
Hi, I'm trying to rename the Administrator Login, and i want to know if my approach is right: void RenameUsr(string hostname, string admusr) { DirectoryEntry entry = new...
1
by: Pixaar | last post by:
hello.. I am new to VB and really new to LDAP I am trying to write an application for our lunch card system...where a student's card is read by a barcode reader and the information (a string)...
6
by: Mark Rae | last post by:
Hi, I'm in the process of updating an ASP.NET v1.1 web app to v2. The app uses ActiveDirectory a great deal, and I'm trying to use the new System.Collections.Generic namespace where possible,...
5
by: ssg31415926 | last post by:
Does anyone have any experience using SCPs (serviceConnectionPoints) in C#? Specifically, I'm trying to use an SCP to locate a service on a server, once the service has created the SCP. I've...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.