473,946 Members | 1,494 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 1009

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

Similar topics

1
5373
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
1366
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
2965
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
1004
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
936
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
2535
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
1535
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
1008
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
1877
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
10155
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
9981
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,...
1
11335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10686
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...
1
8249
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
7423
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
6111
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...
0
6331
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4533
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.