Adding Groups (and users to groups) to Active Directory with .NET
- Posted: Nov 01, 2005 at 7:28 PM
- 57,478 Views
- 13 Comments
Download
How do I download the videos?
- To download, right click the file type you would like and pick “Save target as…” or “Save link as…”
Why should I download videos from Channel9?
- It's an easy way to save the videos you like locally.
- You can save the videos in order to watch them offline.
- If all you want is to hear the audio, you can download the MP3!
Which version should I choose?
- If you want to view the video on your PC, Xbox or Media Center, download the High Quality WMV file (this is the highest quality version we have available).
- If you'd like a lower bitrate version, to reduce the download time or cost, then choose the Medium Quality WMV file.
- If you have a Zune, WP7, iPhone, iPad, or iPod device, choose the low or medium MP4 file.
- If you just want to hear the audio of the video, choose the MP3 file.
Right click “Save as…”
- Mid Quality WMV (Lo-band, Mobile)
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 Closed
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
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