473,832 Members | 2,156 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP... LDAP/ DirectoryServic e Guru

Question 1...

Hi can someone please tell me why I can't put the following LDAP string into
my web.config fill as an <appSetting>

<appSettings>
<add key="strLDAP" value="'LDAP://doamin.domain.c om', 'Administrator' ,
'Password'" />
</appSettings>

The connection string doesn't work when I call it in the code as shown
below...

DirectoryEntry( ConfigurationSe ttings.AppSetti ngs("strLDAP"))

But this works fine if I put it straight into the code!
DirectoryEntry( "LDAP://" & strADPath, "Administrator" , "Password")

I don't get it... It is the same thing????

Question 2...

I have a datagrid and want to get a value from Active Directory and upload
it into a hyperlinkcolumn ... but I can't get the value I need into the
DataNavigateURL Field (See code!) Thanks!

...Code

<asp:hyperlinkc olumn DataNavigateUrl Field="ADValueH ere"
DataNavigateUrl FormatString="u srManDetails.as px?id={0}"
Text="<img border=0 src=../images/edit.gif alt=Edit Page>">
<ItemStyle HorizontalAlign ="Center"></ItemStyle>
</asp:hyperlinkco lumn>
...CodeBehind
Sub GetUserADInfo()
Dim strADPath As String

strADPath = "domain.domain. com"

Dim Entry As DirectoryEntry = New DirectoryEntry( "LDAP://" &
strADPath, "Administrator" , "Password")
' Create a DirectorySearch er object.
Dim mySearcher As New DirectorySearch er(Entry)
' Use the FindOne method to find the object, which in this case, is
the user
' indicated by User Name and assign it to a SearchResult.
mySearcher.Filt er = ("(&(objectCate gory=person)(ob jectClass=user) )")
'Dim MySearchResult As SearchResult = mySearcher.Find One
Dim results As SearchResultCol lection
results = mySearcher.Find All()
dgADUserInfo.Da taSource = results
dgADUserInfo.Da taBind()

End Sub
Can someone please help!

Thanks
Nov 19 '05 #1
0 999

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

Similar topics

1
5363
by: Durairaj Avasi | last post by:
#!/usr/bin/perl -w use Net::LDAP; use Net::LDAP::Util qw(ldap_error_name ldap_error_text); my $ldap = Net::LDAP->new('xy.webdurai.net', port=> 389) or die "$@"; $ldap->debug(15); my @args = ( base => 'DC=xy', scope => "subtree", filter => '(&(objectClass=user)(objectCategory=Person))',
7
1360
by: rh0dium | last post by:
Hi all, I believe I am having a fundamental problem with my class and I can't seem to figure out what I am doing wrong. Basically I want a class which can do several specific ldap queries. So in my code I would have multiple searches. But I can't figure out how to do it without it barfing.. The error is straightforward ..
12
2954
by: Frank Hauptlorenz | last post by:
Hello Out there! I have a DB2 V7.2 Database (Fix11) on Win 2000 Professional. It was before a NT 4 based Domain - now it is a Win 2000 Domain. The database server is a domain member. Now sometimes Win 2000 Clients can't connect to the database. They connect over TCP/IP. The db2log says that the function getHostByName failed. It seems to be only on new installed win 2000 Workstations. Already installed WS have NOT this problem.
0
994
by: Justin Rich | last post by:
I would like to find a way to use the data grid to hook in to the AD. Was looking at the choices for data sources and i didnt see a way to do it, but figured i would ask to see if i missed something using C#, connecting to the AD with System.Directoryservice and would like to use a data grid to show and manipulate this data. Any idea how this can be done? Thank
0
929
by: Tim::.. | last post by:
Can someone please help! I am trying to use DirectoryServices with a datagrid to show the different users in our AD and then have a button that will show the details of the selected user and give the ability to edit the users details! I'm having a problem getting the users details to show up when you click a button in the datagrid and would really appritiate help solving this... The following article gives some guidance but it is in...
3
2526
by: Dennis Dobslaf | last post by:
I try to do some authentication with LDAP. But it's a bit different to the sample in msdn. I wrote a class LdapAuthentication with a method public bool IsAuthenticated(String domain, String username, String pwd) { String domainAndUsername = domain + @"\" + username; DirectoryEntry entry = new DirectoryEntry(_path, domainAndUsername, pwd, AuthenticationTypes.Anonymous);
5
1526
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
1002
by: Sells, Fred | last post by:
I've got the python-ldap version 2.0.11 with python 2.4 under Linux I've got the ldap stuff working for groups, but now I'm trying to use it to change a user password. I get a return of 2 and no error messages but it does not change ldap. I've tried it with uid = 'joeblow' and with oldpw=whatever it was with the same result. Anyone know what I'm missing?
0
1866
by: Sells, Fred | last post by:
I'm running python 2.5 (or 2.4) in an XP environment. I downloaded and installed the .dll's from OpenLDAP-2.4.8+OpenSSL-0.9.8g-Win32.zip and copied the .dll's in c:/windows/system32 as instructed now I get this error. Is there anyway to avoid building the python_ldap binaries? Apart from being lazy, I've got a secure system policy issue if I start compiling apps. I could give up and just start running in linux, but myxp environment is...
0
9795
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
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10781
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
9320
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...
1
7753
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
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
5624
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4421
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
3078
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.