Posted By: Robert Shelton, Jr. | Nov 1st, 2005 @ 7:28 PM | 50,236 Views | 13 Comments

Federal Developer Evangelist, Robert Shelton, takes you through a 8 minute walkthrough/demonstration of how to create a group in active directory with .NET and to add users to that group.  This demonstration is using the DirectoryServices namespace of the .NET framework.





You can find the code at my blog: http://sheltonblog.com 


My other Programming AD Screen Casts:
- Searching AD with .NET:
http://channel9.msdn.com/Showpost.aspx?postid=132740
- Adding users to Active Directory with .NET
http://channel9.msdn.com/showpost.aspx?PostID=130700
List of Group attributes for Active Directory:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adschema/adschema/c_group.asp
List of values for the groupType Attribuet:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adschema/adschema/a_grouptype.asp

~Robert

Media Downloads:
Rating:
1
0
While it's nice of you to help people by posting this webcast, I really think that it's completely worthless that there is no source code that can be downloaded. It's really hard to remember everything from the webcast, and it's even harder to copy/paste from windows media player!!! Perplexed

That was cool thanks!. Code would be nice.
After a long time of looking i found a good app that demos a bunch of AD functions including adding user to group. get the free one.
http://www.dotnetactivedirectory.com/
I thought the screen show was great it is what I was looking for.

I'm having trouble finding the source code for the project.  Could you post a link to the source code?

Thanks
Troy
I'm also having an issue with the DirectoryEntry.Exists command it keeps telling me that

"Logon failure: unknown user name or bad password."

I would have thought that adUserFolder object would contain the connection information since I specified at the beginning.


Any ideas?

Thanks
Troy
Exactly what I'm looking for thanks!

Has anyone resolved the Logon failure: unkown user name or bad password?  I'm having the same issue, only when I used the Exists function.

Here is an screen shot of my issue.
http://picasaweb.google.com/BlogZonka/CodeScreenshots/photo#5057082651973825346

I know it isn't permission problem, because if I comment out the line that causes the error:

// if (DirectoryEntry.Exists(newUser.Path)) return;

Then it works fine, but if the user doesn't exist in AD.

In other words, I can commit with no problems.

Just for the sake of permissions, I even logged in as administrator, still the same problem.

Thanks
We just discovered why I was getting the error.

I was trying to use the DirectoryEntry.Exist() function on a non trusted computer to the test AD Domain Controller.

Since you pass the username and password when adding the user to the User group, the account is enough for the DirectoryEntry object to validate with AD.

So remember that when testing on a system to make sure that system is part of the domain.
Microsoft Communities