?
Solved

ADSI with c# (asp.net) questions and help

Posted on 2004-11-24
5
Medium Priority
?
529 Views
Last Modified: 2008-03-04
Hi there,

I wonder if anybody can help?

I have been trying to looki at implementing ADSI with c# (asp.net) but it has been very hard to find any documentation to the available object, methods, properties etc.

Tried search for a book but nothing withc#,

Does anybody know where i can find some documention or help with ADSI ... specifically with c#

Also, i noticed ADSI uses COM (am I right?), so is ADSI an old technology that is going to be replaced (or already replaced) with a new technology??

Is ADSI installed autoamtically with Windows 2003 Server (IIS) and asp.net?

My main aim with adsi is to be able to create Websites, ftp accounts, Email accounts (which i have only found MS Exchange to support, maybe I am wrong??)

Any help or information with regards to any of the above woudl be really appreciated

Thanks in advance

Ian
0
Comment
Question by:ianinspain
  • 2
  • 2
5 Comments
 
LVL 16

Accepted Solution

by:
muzzy2003 earned 1400 total points
ID: 12662820
You use ADSI via the System.DirectoryServices namespace. There is an overview at:

http://www.15seconds.com/issue/020730.htm
0
 
LVL 1

Assisted Solution

by:paresh_vs
paresh_vs earned 600 total points
ID: 12663167
Hi,
  Try following links also. Hope it helps you.

http://www.troobloo.com/tech/asp.90.shtml
http://www.123aspx.com/redir.aspx?res=30841

Regards
Paresh
0
 

Author Comment

by:ianinspain
ID: 12684990
Thanks everyone, actually I managed to pickup an ADSI help file, which is very VB /VBSCRIPT types

Anyone know an easy way to use this and convert to .NET classes.... is there an easy way??

I wish somebody would produce a c# / ADSI book..

ADSI books seem very thin on the ground..

Ian
0
 
LVL 16

Assisted Solution

by:muzzy2003
muzzy2003 earned 1400 total points
ID: 12685084
That is exactly what the System.DirectoryServices namespace is all about. Here is an example that adds a user to a group:

DirectoryEntry dom = new DirectoryEntry();
DirectoryEntry group = dom.Children.Find("CN=Consulting");

// Add a single user to a group;
DirectoryEntry usr = group.Children.Find("CN=New User");

// To add multiple users to a group use
//group.Properties["member"].AddRange(new string[] {"userDN1","userDN2"});

//To add the user's distinguished name to the member property
//on the group object, use the Add method.
group.Properties["member"].Add(usr.Properties["distinguishedName"].Value);

//Commit the changes to the directory.
group.CommitChanges();

As an alternative, search MSDN for "Using COM Interop to Access ADSI".
0
 

Author Comment

by:ianinspain
ID: 12703848
cheers guys! points split,.

Best regards

Ian
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question