Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Active Directory Problems...

Reply
Thread Tools

Active Directory Problems...

 
 
=?Utf-8?B?VGltOjouLg==?=
Guest
Posts: n/a
 
      02-07-2005
Can someone please tell me why the following doesn't return any results! I
don't get an error but at the same time I don't recieve any results from the
AD????

Would be really grateful for any advice!

Thanks


...code..
Sub SetupSession()
Dim strUserName As String
Dim strADPath As String

strUserName = "netadmin" 'HttpContext.Current.User.Identity.Name
strADPath = "domain.domain.com"

Dim Entry As DirectoryEntry = New DirectoryEntry("LDAP://" &
strADPath, "username", "xxxxxxxx")
' Create a DirectorySearcher object.
Dim mySearcher As New DirectorySearcher(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.
Dim ResEnt As SearchResult = mySearcher.FindOne()
' Assign a property name to propKey.
Dim propKey As String
' Assign a property name to propKey.
For Each propKey In ResEnt.Properties.PropertyNames
' Assign the property value to prop.
Dim prop As [Object]
' Assign the property value to prop.
For Each prop In ResEnt.Properties(propKey)
' Handle results. Be aware that the following WriteLine
' only returns readable results for properties that are
strings.
Console.WriteLine("{0}:{1}", propKey, prop.ToString())
Next prop
Next propKey
' Add error handling.



End Sub
End Class
 
Reply With Quote
 
 
 
 
Patrick Olurotimi Ige
Guest
Posts: n/a
 
      02-07-2005
Tim try seeing this Article at:-
http://www.wimdows.net/articles/article.aspx?aid=13
Hope it helps
Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASA 5520 Active/Active Conguration Example UBEST Cisco 5 03-24-2008 05:13 PM
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() are not returning the specified directory Nathan Sokalski ASP .Net 2 09-06-2007 03:58 PM
Rolling upgrade of Active-active cluster for SQL server 2000 =?Utf-8?B?U3VzaGls?= MCSE 1 02-16-2006 05:57 AM
Thunderbird filters "active" but not "active" =?ISO-8859-2?Q?Rafa=B3_=A3o=BFy=F1ski?= Firefox 5 05-18-2005 07:27 AM
Active Directory Search fails ("The directory service is unavailab ejcosta ASP .Net Security 2 10-08-2004 09:57 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57