我正在尝试在Active Directory的根目录中创建新的OU,但是它会不断抛出异常。是否可能是因为我要成为管理员?
链接到屏幕截图: https://drive.google.com/file/d/1ERLT64PIWrCoECzq0GGTdwMR1mQqln9w/view?usp=sharing
`
public void CreateGroup()
{
DirectoryEntry dir = new DirectoryEntry("LDAP://ENCOTEC");
DirectorySearcher search = new DirectorySearcher(dir);
search.Filter = "(OU=IT System)";
SearchResult it = search.FindOne();
if (it == null)
{
DirectoryEntry newEntry = dir.Children.Add("OU=IT System", "organizationalUnit");
dir.CommitChanges();
}
`