473,385 Members | 2,162 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.

[Active Directory] best protocols

RTT
does anyone has axperience with accessing AD information through VB.Net. Is
the best protocol LDAP? does anyone has a site for information about AD and
VB.Net cause it's the first time i have to work with active directory in
vb.net so all sources of information would be helpfull. Thanks
Nov 21 '05 #1
5 2738
AFAIK, the only protocol is LDAP. You need to add a reference to Active DS
i believe.

Then use:

Dim oContainer As IADsContainer
Dim oUser As IADsUser

oContainer = GetObject
"LDAP://sluibericaa.sluiberica.slu.edu/CN=Users,OU=Students,OU=UsersHierarchy,DC=sluiberi ca,DC=slu,DC=edu")

oUser = oContainer.Create("user", "CN=" & "SmithA")
oUser.FirstName = "Alan"
oUser.LastName = "Smith"
oUser.SetInfo
This is an example. Obviously you need to set more properties!

--

Daniel
MCSE, MCP+I, MCP in Windows 2000/NT

--------------------------------------
remove the 2nd madrid from my mail address to contact me.

"RTT" <RT*@pandora.be> wrote in message
news:O0**************@TK2MSFTNGP14.phx.gbl...
does anyone has axperience with accessing AD information through VB.Net.
Is
the best protocol LDAP? does anyone has a site for information about AD
and
VB.Net cause it's the first time i have to work with active directory in
vb.net so all sources of information would be helpfull. Thanks

Nov 21 '05 #2
AFAIK, the only protocol is LDAP. You need to add a reference to Active DS
i believe.

Then use:

Dim oContainer As IADsContainer
Dim oUser As IADsUser

oContainer = GetObject
LDAP://DNSDOMAINNAME/CN=Users,OU=EMPLOYEES,,DC=mydomain,,DC=com)

oUser = oContainer.Create("user", "CN=" & "SmithA")
oUser.FirstName = "Alan"
oUser.LastName = "Smith"
oUser.SetInfo
This is an example. Obviously you need to set more properties!

--

Daniel
MCSE, MCP+I, MCP in Windows 2000/NT

--------------------------------------
remove the 2nd madrid from my mail address to contact me.

"RTT" <RT*@pandora.be> wrote in message
news:O0**************@TK2MSFTNGP14.phx.gbl...
does anyone has axperience with accessing AD information through VB.Net.
Is
the best protocol LDAP? does anyone has a site for information about AD
and
VB.Net cause it's the first time i have to work with active directory in
vb.net so all sources of information would be helpfull. Thanks


Nov 21 '05 #3
On Fri, 4 Mar 2005 11:43:34 +0100, "Daniel" <gr****@madridmadridsoleado.com> wrote:

¤ AFAIK, the only protocol is LDAP. You need to add a reference to Active DS
¤ i believe.
¤

The WinNT provider is also available for both NT and AD domains. Sometimes it's much easier to use
but is considerably less capable.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 21 '05 #4
RTT
For the moment i can read through a hierachie of the AD by browsing bye the
use of LDAP:// strings

Now i can get to the level of finding the string of a user
LDAP://CN=BlendemanDirk,OU=Users,OU=Antwerp,OU=BE,OU=SE,D C=be,DC=domain,DC=w
e
but now the problems is, how do i find date about the users. I Would like to
retrieve his emailaddress and the groups his in.

Does anyone know a way?

or a simple way to find a user in the active directory, or to find a group
and retrieving it's users...

thxs in advance

"RTT" <RT*@pandora.be> wrote in message
news:O0**************@TK2MSFTNGP14.phx.gbl...
does anyone has axperience with accessing AD information through VB.Net. Is the best protocol LDAP? does anyone has a site for information about AD and VB.Net cause it's the first time i have to work with active directory in
vb.net so all sources of information would be helpfull. Thanks

Nov 21 '05 #5
On Thu, 10 Mar 2005 10:58:11 +0100, "RTT" <RT*@pandora.be> wrote:

¤ For the moment i can read through a hierachie of the AD by browsing bye the
¤ use of LDAP:// strings
¤
¤ Now i can get to the level of finding the string of a user
¤ LDAP://CN=BlendemanDirk,OU=Users,OU=Antwerp,OU=BE,OU=SE,D C=be,DC=domain,DC=w
¤ e
¤ but now the problems is, how do i find date about the users. I Would like to
¤ retrieve his emailaddress and the groups his in.
¤
¤ Does anyone know a way?
¤
¤ or a simple way to find a user in the active directory, or to find a group
¤ and retrieving it's users...
¤

The following code should help:

Public Function GetUserInfo(ByVal UserID As String)

Dim RootDSE As New DirectoryServices.DirectoryEntry("LDAP://RootDSE")
Dim DomainDN As String = RootDSE.Properties("DefaultNamingContext").Value
Dim ADEntry As New DirectoryServices.DirectoryEntry("LDAP://" & DomainDN)
Dim ADSearch As New System.DirectoryServices.DirectorySearcher(ADEntry )

If UserID = "" Then
UserID = System.Security.Principal.WindowsIdentity.GetCurre nt.Name.Split("\"c)(1)
End If

Dim ADSearchResult As System.DirectoryServices.SearchResult
ADSearch.PropertiesToLoad.Add("memberOf")
ADSearch.Filter = ("(samAccountName=" & UserID & ")")
ADSearch.SearchScope = SearchScope.Subtree
Dim UserFound As SearchResult = ADSearch.FindOne()
Dim propertyCount As Integer = UserFound.Properties("memberOf").Count
If Not IsNothing(UserFound) Then
Console.WriteLine(UserFound.GetDirectoryEntry().Pr operties.Item("mail").Value)
Dim propertyCounter As Integer
Dim dn As String

For propertyCounter = 0 To propertyCount - 1

dn = CType(UserFound.Properties("memberOf")(propertyCou nter), String)
Console.WriteLine(dn.ToString)
Next
End If

End Function
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 21 '05 #6

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

Similar topics

2
by: Victor Lokhmatov | last post by:
Hello Everyone, My company has asked me to put a company directory on our intranet site and I'm trying to use php to extract the users from our active directory server. I've got everything...
0
by: Henning Kristensen | last post by:
Hi I need a little help with some VB.Net code.. I am pulling my computer's GUID out using WMI Dim wmiObj As New System.Management.ManagementObjectSearcher("SELECT UUID FROM...
4
by: Patirck Ige | last post by:
Would it be easier to have an intranetsystem built based on some security gruopson Active directory or having to use a Database to have a validation store and Roles. Which way would be the best to...
4
by: Patrick.O.Ige | last post by:
If i want to generate a menu structure depending on who is logged in in an intranet system(using windows authentication) is it better to use the GROUPS in Active Directory or to move the Active...
0
by: jakobsgaard | last post by:
It is possible to Map a certificate to a Active Directory User Account from DotNet? Please provide an example. Best regards, Ejnar Jakobsgaard...
0
by: Matt | last post by:
Hi, I am looking for an Active Directory object selection for ASP.net 2. My ASP.net page has a text field to enter a user's or computer's LDAP path directly. And a "Find..." button that shall...
4
by: IainM | last post by:
How can I enumerate AD objects (only in a given OU, not sub OUs) using the DirectoryEntry object? Let me know of this is the wrong forum for this question. Thanks, Iain
7
by: =?Utf-8?B?TWlrZQ==?= | last post by:
I'm trying to use the DirectorySearcher.FindOne() method to get the display name of the current user. The code runs on a server behind a web service. Everything works fine when I run it on my...
4
by: Spam Catcher | last post by:
Hello All, I need to integrate my application into Active Directory. My application has the concept of groups, users, and also individual permissions. Users can be part of a group such as...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.