to create & find users & groups in Active Directory i’ve been using this code:
http://anyrest.wordpress.com/2010/06/28/active-directory-c/
that is using the new System.DirectoryServices.AccountManagement namespace that was introduced in .net 3.5…
i’d like to add a method that creates a new OU (if the OU doesnt exist already) using the newest technology with .net 3.5 or 4.0 (and not using the old System.DirectoryServices)
any idea how to do that ?
According to Managing Directory Security Principals in the .NET Framework 3.5 specialy the architecture here under and System.DirectoryServices.AccountManagement Namespace article, accountManagement is for users groups and computers (security principals).
For
organizationalUnit, you can useSystem.DirectoryServices.ActiveDirectoryhere is an example :Don’t forget to use
using(){}directive