Adding Groups (and users to groups) to Active Directory with .NET
- Posted: Nov 01, 2005 at 7:28 PM
- 58,249 Views
- 13 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
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
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
Again, thanks for stating the obvious. Sometimes the obvious, isn't so obvious!
Again, in the future, I will save the demo code and posted it with a link within the Screencast description form.
~Robert
http://www.dotnetactivedirectory.com/
I'm having trouble finding the source code for the project. Could you post a link to the source code?
Thanks
Troy
"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
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
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.
That says:
The following Visual Basic .NET example demonstrates how to add a single member to a group.
Can anyone tell me what this sample is supposed to do? Is it incorrect? I tried to post Community Content that it didn't work and I successfully used group.invoke("Add",userDN) instead. But my browser just goes into some kind of loop.
This has solved a problem for me too, I'm glad I found this page. I'm also pleased that I stumbled across discount voucher information.
I think it's a good idea to explore how an agent-isolated model can be used to simplify expressing "ownership" of the UI. It certainly seems worth exploring in some depth. Thesis.
Remove this comment
Remove this thread
close