473,717 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Active Directory Programming in C#?

I need to retrieve and set information in Active Directory in a new project
that I'll be working on. I went to Amazon.com to look for a good book on
this subject but found books on this subject all using C++. Can I make ADSI
and LDAP API calls using C#? Can someone recommend a good book for this
subject with C# as sample code?

Thanks,
Alpha
Dec 19 '05 #1
2 8129
You're in luck. System.Director yServices does exactly that (You have to add
it as a reference in VS2003, not sure about 2005).
Check out:
http://msdn.microsoft.com/library/de...ryservices.asp

Snip from the top of the link above:
The System.Director yServices namespace provides easy access to Active
Directory from managed code. The namespace contains two component classes,
DirectoryEntry and DirectorySearch er, which use the Active Directory
Services Interfaces (ADSI) technology. ADSI is the set of interfaces that
Microsoft provides as a flexible tool for working with a variety of network
providers. ADSI gives the administrator the ability to locate and manage
resources on a network with relative ease, regardless of the network's size.

The classes in this namespace can be used with any of the Active Directory
service providers. The current providers are: Internet Information Services
(IIS), Lightweight Directory Access Protocol (LDAP), Novell NetWare
Directory Service (NDS), and WinNT.

ADSI is a programmatic interface for Microsoft Active Directory that enables
your applications to interact with diverse directories on a network, using a
single interface. Using ADSI, you can create applications that can perform
common tasks, such as backing up databases, accessing printers, and
administering user accounts.

"Alpha" <Al***@discussi ons.microsoft.c om> wrote in message
news:7D******** *************** ***********@mic rosoft.com...
I need to retrieve and set information in Active Directory in a new project
that I'll be working on. I went to Amazon.com to look for a good book on
this subject but found books on this subject all using C++. Can I make
ADSI
and LDAP API calls using C#? Can someone recommend a good book for this
subject with C# as sample code?

Thanks,
Alpha

Dec 19 '05 #2
Thanks. I guess the answer to my question is yes, that I can use ADSI with
C# code.

"Craig S" wrote:
You're in luck. System.Director yServices does exactly that (You have to add
it as a reference in VS2003, not sure about 2005).
Check out:
http://msdn.microsoft.com/library/de...ryservices.asp

Snip from the top of the link above:
The System.Director yServices namespace provides easy access to Active
Directory from managed code. The namespace contains two component classes,
DirectoryEntry and DirectorySearch er, which use the Active Directory
Services Interfaces (ADSI) technology. ADSI is the set of interfaces that
Microsoft provides as a flexible tool for working with a variety of network
providers. ADSI gives the administrator the ability to locate and manage
resources on a network with relative ease, regardless of the network's size.

The classes in this namespace can be used with any of the Active Directory
service providers. The current providers are: Internet Information Services
(IIS), Lightweight Directory Access Protocol (LDAP), Novell NetWare
Directory Service (NDS), and WinNT.

ADSI is a programmatic interface for Microsoft Active Directory that enables
your applications to interact with diverse directories on a network, using a
single interface. Using ADSI, you can create applications that can perform
common tasks, such as backing up databases, accessing printers, and
administering user accounts.

"Alpha" <Al***@discussi ons.microsoft.c om> wrote in message
news:7D******** *************** ***********@mic rosoft.com...
I need to retrieve and set information in Active Directory in a new project
that I'll be working on. I went to Amazon.com to look for a good book on
this subject but found books on this subject all using C++. Can I make
ADSI
and LDAP API calls using C#? Can someone recommend a good book for this
subject with C# as sample code?

Thanks,
Alpha


Dec 19 '05 #3

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

Similar topics

9
3725
by: Mario Rodriguez | last post by:
Hi people. I have a problem adding users to Win2003 active directory programatically. When I execute my app throws the following exception: .................The specified directory service attribute or value does not exist........... Exactly the same code works fine on my win2000 active directory. My app include the use of the extensionAtributes and I'm not sure if the extensionAttributes feature was removed from win2003 Active...
0
1095
by: Ciccio | last post by:
Hi I'm new to active directory programming. From an asp.net application that uses AD I got an excepion of type: System.Runtime.InteropServices­.COMException (0x8000500C): The Active Directory datatype cannot be converted to/from a native DS datatype at System.DirectoryServices.Inter­op.IAds.GetEx(String bstrName) at System.DirectoryServices.Prope­rtyValueCollection.PopulateLis­t()
3
2330
by: Gentian Hila | last post by:
Hello there, I was wondering if any one knows some good source, book, or even MSDN resurce (I found something there, but seems to be very little) that instructs how to create in VB.NET programs for Active Directory (adding user, creating folder, changing permissions, creating exchange mailboxes). I have done some user, home folder, mailbox creation in VBScript, but now I am planning to do a GUI program in VB.NET that does basically the...
0
2028
by: RTT | last post by:
here is my current situation. I develop a program on my computer's localhost. From there i contact Active directory succesfull using a connectionstring like: LDAP://OU=BE,OU=SE,DC=eu,DC=aagp,DC=corp. This works fine. My computer is in and OU under the BE folder, and so is my User. I have no problems connecting to the Active Directory. But now that my code is finished i want to put it online on one of the company servers. but when i...
1
1456
by: Arne Tiedemann | last post by:
Hello NG, I'm new in programming VB.NET and I'll create a Project to read and change Active Directory Users, Groups, and Organisational Units. I test with VisualStudio 2003 but wenn i access Users with System.DirectoryServices.DirectoryEntry I get an error when I make objUser.CommitChanges(). Can anybody tell me how to access and Change Active Directory Object with VB.NET? Thanks at All -- Arne Tiedemann www.bitbuilder.de
2
5971
by: Jim in Arizona | last post by:
My goal, somehow, is to populate a dropdownlist with all the user names in active directory. I don't even know where to begin, really. I added a reference to System.DirectoryServices so I could use the System.DirectoryServices.ActiveDirectory namespace. I don't even know if this is the right way to go as I can't seem to find anything in that namespace that would help me query active directory for names. I can't use an LDAP query...
4
5891
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
18
23785
by: Arthur | last post by:
Hi All, I would like to get the name of the user given their networkID, is this something Active Directory would be useful for?(For intranet users) If so, can you please point me to some sample code/examples? Thanks in advance, Arthur
5
1454
by: Kaamp | last post by:
I am trying to create a simple AD search page where any of my co workers can input and name and get in return phone numbers. I don't need anything fancy, since most of the internal site has already been created using Microsoft expressions, and with the standard items in IIS. I know this question has been asked but every search through google has not been able to provide me with the coding I want to inject into the web site.
0
8719
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
9348
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
9202
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9109
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
9048
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...
0
4478
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
4739
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2545
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2120
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.