473,809 Members | 2,908 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[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 2754
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.slu iberica.slu.edu/CN=Users,OU=Stu dents,OU=UsersH ierarchy,DC=slu iberica,DC=slu, DC=edu")

oUser = oContainer.Crea te("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******** ******@TK2MSFTN GP14.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=EMP LOYEES,,DC=mydo main,,DC=com)

oUser = oContainer.Crea te("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******** ******@TK2MSFTN GP14.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****@madridm adridsoleado.co m> 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******@amerit ech.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=BlendemanDir k,OU=Users,OU=A ntwerp,OU=BE,OU =SE,DC=be,DC=do main,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******** ******@TK2MSFTN GP14.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=BlendemanDir k,OU=Users,OU=A ntwerp,OU=BE,OU =SE,DC=be,DC=do main,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(ByV al UserID As String)

Dim RootDSE As New DirectoryServic es.DirectoryEnt ry("LDAP://RootDSE")
Dim DomainDN As String = RootDSE.Propert ies("DefaultNam ingContext").Va lue
Dim ADEntry As New DirectoryServic es.DirectoryEnt ry("LDAP://" & DomainDN)
Dim ADSearch As New System.Director yServices.Direc torySearcher(AD Entry)

If UserID = "" Then
UserID = System.Security .Principal.Wind owsIdentity.Get Current.Name.Sp lit("\"c)(1)
End If

Dim ADSearchResult As System.Director yServices.Searc hResult
ADSearch.Proper tiesToLoad.Add( "memberOf")
ADSearch.Filter = ("(samAccountNa me=" & UserID & ")")
ADSearch.Search Scope = SearchScope.Sub tree
Dim UserFound As SearchResult = ADSearch.FindOn e()
Dim propertyCount As Integer = UserFound.Prope rties("memberOf ").Count
If Not IsNothing(UserF ound) Then
Console.WriteLi ne(UserFound.Ge tDirectoryEntry ().Properties.I tem("mail").Val ue)
Dim propertyCounter As Integer
Dim dn As String

For propertyCounter = 0 To propertyCount - 1

dn = CType(UserFound .Properties("me mberOf")(proper tyCounter), String)
Console.WriteLi ne(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
5530
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 working, however, when the list of users is shown in the output, it seems to display the users in the order their accounts were created, with Administrator obviously being first. What do you think would be the best way to get the list to be sorted by...
0
352
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 Win32_ComputerSystemProduct" Dim objMgmt As System.Management.ManagementObjec Dim MyByteGuid As Byte( Dim MyStringGuid As Strin Dim MyGuid As Gui For Each objMgmt In wmiObj.Ge
4
1392
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 go?
4
2353
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 Directory groups into a Sql Server database and base the authrorization and authentication on the SQL Server roles/groups? Whats the best way to make use of the GROUPS in active directory to authorize users apart from using web.config where you...
0
2746
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 ------------------------------------------------- To map a certificate to a user account Open Active Directory Users and Computers.
0
1349
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 display an Active Directory search GUI like the dialog shown on a Windows Server 2003 under "Active Directory Users and Computers - Find...". I could not find an ASP.net server control for this. I know that I can search the Active Directory using...
4
5898
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
14249
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 local machine but the FindOne() method fails when I deploy it to the server. I'm at a loss and any help would be appreciated. This is the code that works on my local machine but not on the server. DirectorySearcher search = new...
4
8281
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 administrators, but explicit permissions may also be set. Can active directory handle this too? For example: Administrators can typically add/remove/edit/delete an item,
0
9721
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
9600
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
10375
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
10114
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
7651
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
6880
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
5548
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
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
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

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.