Im trying to run an LDAP script from an ASP page. I know very little about LDAP, and just based on some sample code I found on the internet, I got the following:
<%
Set Conn=CreateObject("ADODB.Connection")
Conn.Provider="ADSDSOObject"
Conn.Open("ADs Provider")
Set rs=Conn.Execute("ldifde -f UsersFile.ldf -p Subtree -r
"(&(objectClass=user)(showinaddressbook=CN=Global Address
List,OU=Microsoft Exchange,OU=CMC,OU=D-corp,OU=Organizations,DC=d-corp,DC=corp))"")
Do While Not rs.EOF
ReturnValue=rs.Fields(0)
Response.Write ReturnValue&"<BR>"
%>
Obviously, it does not work !! If someone can help me with what direction I should be proceeding in to change the code so that it works?
Is it because I havent specified the server name or something, or is it because I cant execute an LDAP command like ldifde in such a straightforward manner and I need to change that?
I am trying to use windows (nt/xp) authenication for a website which can be accessed from internet as well as intranet. Our windows authentication uses active directory(win 2kservers). On login page for website, I have get username from windows and then ask for entering the password again. Send this information to active directory and query active directory if user is employee or contractor. if Employee, then user can access the contents on web site other wise user gets a messge saying insuffcient priviledges. I would appreciate if some one could send me code snippets.
The users on my network, log in using a novell login box when they boot up their pc. When they open their browser, they have to enter the same username and password to log into our intranet. Is there anyway I can get rid of the login prompt for the browser, and log them in automatically using the initial windows login they entered. I would like to authenticate users using an LDAP query also.
Can anyone direct me to some simple ASP code samples to do the following? I'd like to, given a UID, check to see if an individual in a public directory is part of a given OU. I've noticed that for a given person there can be several OU's, so I don't think it'd be possible to select an OU. However, can I select cn where UID = xxx and OU = xxx and then check to see if it's not null? didn't know whether to put this in here or an LDAP group
I am trying to access ldap with standard ASP. The code works on the web server where I am developing but any other PC on network gets the following error:
Providererror '80040e37'
Table does not exist. /training/index.asp, line 41
I'm trying to get user details using ASP under IIS (Win2000) with the following code:
Set User = GetObject("WinNT://domainname/" & mid(strNTUser,8) & ",user") strNTUserFullName= User.Fullname
The website this is running under uses Windows Authentication only no anonymous logins and this presumably is why I get the error 'General access denied error' from AD as the logged in user's credentials are not passed to the AD domain controller that is being queried for the users details.
how to I get this to work whilst keeping Windows Authentication?I only need the most basic details about the user so writing LDAP queries and creating recordsets etc seems like overkill and presumably the same problem will occur?
I have a page which grabs data from Active Users which was working great last week. All of a sudden my code doesn't like some of the field names. For the purpose of keeping this short let's just say it's one field 'Department' Code:
Dim department MyFullName = "FRED BLOGGS" SQLStmt = "SELECT name,physicaldeliveryofficename,department " & _ "FROM 'LDAP://lvp-ad.myserver.wan' " & _ "WHERE objectClass = 'user' AND name='" & MyFullName &"'" Set Conn = CreateObject("ADODB.Connection") Conn.Provider = "ADSDSOObject" Conn.Open "ADs Provider" Set rs = Conn.Execute(SQLStmt) So, if i remove department all works fine. Any help appreciated.
We need to use LDAP in conjunction with our ASP pages. Are there LDAP API that can be used either from VB or VBScript ? Where can I find sample codes for it ?
I'm using the function copied below to authenticate users in LDAP before allowing them onto our intranet site. This works great! But what I'd like to do now is use the LDAP connection it creates to retreieve the users actual name.
I dont know how to do this so I've been looking for examples I can learn from on the net. I have found snipits of other people code but I've been tying myself in knots trying to fit them into my function and failing miserably.
Could anyone tell me what I need in the function below to get this information. From what I've seen I think I need to use some kind of filter on the LDAP object, but I dont know how to implement it. Code:
I have a page in my Intranet with the contacts of the Active Directory.
My problem is when i want to sort contents. I only can order one field. In the example it is ordring by "Department". but those in same department came sorted by Object USN. I want them ordered by name after ordered by Department. I tried "order by Department and order by name" but it do not work. Code:
I have a number of applications that use a particular technique to authenticate users using IWA and LDAP.
These are for intranet application where the users all use IE6, however I'm trying to debug some javascript code and I find that easier to do with FF. However my applications that use this authentication technique have problems when running through FF.
I get an 'error '80072020' authuser.asp, line 20', which point to an LDAP call: Code:
Could someone please tell me what is going on here. If I hard code a username and password, the script works fine, but when I set the user name and password with a reqeust.form, I always get the invalid user notice. Then after getting that a couple of times, even hard coding the user name and password will cause the script to fail.
The error number it gives is 424.
<%@ Language = VBScript %> <% option explicit %> <% dim UserName, Pswd, oADsObject, strADsPath, oADsNamespace on error resume next
Set oADsObject = oADsNamespace.OpenDSObject(strADsPath, UserName, Pswd, 1)
if not (Err.number = 0) then response.write "Invalid Username or Password!" else response.write "Access Granted." end if set oADsObject = nothing set oADsNamespace = nothing
I am trying to access a LDAP server with ASP with no sucess. I can do it with ColdFusion but not ASP. All the examples I have seen so far do not use passwords or userid's. My LDAP server requires password and user credentials. Can anyone point me in the right direction.
How I can connect to non-Microsoft LDAP-server and select record from him ? With best regards, Aleksandre Skornitchenko. IT Dept., Togliatti Branch MegaFon E-mail: Join Bytes! ICQ: 7829547
I'm trying to build a page that looks up users based on CN or SN and returns specific information - IE fullname, phone, email etc - I can get the look up to work, but so far the only information I can spit out is:
cn=HAR,ou=CATS,ou=EMPL,ou=CONT,o=COName
some information and sample code that will allow me to display this info?
I'm porting some code over to use ADS for user data lookup, but can't find a clear reference anywhere to the old windows 2000 userid (the network login). Does it still exist within LDAP, or will I have to match to sn & givenName?
I am learning asp and I want to create a page that will provide the user with a user name and password box from there it would authenticate them against my ldap (sun) or AD ldap servers ( I would prefer to use the sun ldap server but I can use either)
from there if they are successfull they would get a special website, if they are not successfull they get an error.
I have been reading for the past couple hours now about this and searching google and I just can't find a solid answer, I found some information on how to make a ldap edit page but not just a simple ldap authentication page.
another question I have is how I can use this to then edit a database. for example after the user logs in they get a page that asks them a couple of questions. when they fill out there answers and hit submit I want it to get sent to a database but classified under there user id so I can run reports on provided what answers. Code:
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 currently use ADO (adoConn.Provider = "ADSDSOObject") to access user information in the domain Active Directory. I want to expand my application to be able to access user information in other LDAP compatable user lists (LINUX or UNIX for example). I did some searching on deja.com (google groups) and microsoft's newsgroups, but couldn't find anything.
I have a form which only authenticated users can access (Basic Auth against an ADS domain). Currently, I use Request.ServerVariables("LOGON_USER") to display the login name of the user. This information is both displayed and submitted as apart of the form in a hidden field.
What I would like to do is to poupulate the form with user details from an LDAP directory (ADS at this stage, but quite possibly changing to CA eTrust) such as Name, Email Address, and contact numbers. Does anyone know of any resources which might outline how to acheive this, preferably with any code samples to acheive this?
i mentioned in a previous thread that i've been trying, with varying degrees of success, to access AD fields through the use of a SQL statement and LDAP. The problem i'm facing now is how to update AD using the same method - i've tried the usual SQL update command, but with no luck.
What I need to do is allow the currently logged in user to update specific parts of their AD profile. Finding the username with request.servervariables is simple enough, but whenever I try and write to AD it throws up errors. Does anybody have any experience of this? Is it even possible to update AD using SQL, and if not are there any other methods of doing so?
I am using classic asp and making a connection to LDAP server using SQL code under IIS 5 on my localhost and it works great. I have a form and form fields that pull from active directory. Now, once I get the web team to deploy these files to the webserver where all users will be able to run this app.(this server is using IIS 6), my form fields show up blank. For the life of me I cannot see what is wrong or different except the IIS version. Also, I have gotten the IIS logs and they don't tell me anything.
I am using classic asp and making a connection to LDAP server using SQL code under IIS 5 on my localhost and it works great. I have a form and form fields that pull from active directory.
Now, once I get the web team to deploy these files to the webserver where all users will be able to run this app.(this server is using IIS 6), my form fields show up blank.
For the life of me I cannot see what is wrong or different except the IIS version. Also, I have gotten the IIS logs and they don't tell me anything. Code:
I am trying to access user info in a remote Active Directory Server with an ASP application. For testing purpose, I set up a test domain controller (Win2k Server) and installed Active Directory Server.
I am able to retrieve the user info with the program below when I run the program(http://testmachine/test.asp) on the test domain controller machine. However, if I run the program(http://machine2/test.asp) from another machine in the same domain (Windows XP), it returns empty record set. Code:
I'm trying to retrieve data on all users currently within our active directory system, and although i have had some success there is one field that i still can't extract the values from - postalAddress. I'm using the following code: