将批量用户添加到AD [英] ADD Bulk users to AD
问题描述
salam,
我正在研究将用户添加到MS Active目录的项目.
我需要使用:
从文件(csv,excel)将批量用户添加到活动目录中
公共静态DirectoryEntry CreateNewUser(字符串cn)
{
字符串LDAPDomain ="/CN = Users," + GetLDAPDomain();
DirectoryEntry oDE = GetDirectoryObject(LDAPDomain);
DirectoryEntry用户= oDE.Children.Add("CN =" + cn,"user");
user.CommitChanges();
oDE.Close();
oDE.Dispose();
返回用户;
}
我一个接一个地添加用户,我想阅读文件并在命令行执行行
谢谢,
salam,
i ''m working on project adding users to MS Active directory.
i need to add bulk user to the active directory from file (csv, excel) using :
public static DirectoryEntry CreateNewUser(string cn)
{
string LDAPDomain ="/CN=Users," + GetLDAPDomain();
DirectoryEntry oDE= GetDirectoryObject(LDAPDomain);
DirectoryEntry user = oDE.Children.Add("CN=" + cn, "user");
user.CommitChanges();
oDE.Close();
oDE.Dispose();
return user;
}
I add user one by one, i want to to read the File and excute the command line be line
thanks,
推荐答案
所以写一个加载csv文件的方法,遍历每一行,并在循环中调用此方法.
So write a method that loads the csv file, loop through each line and within the loop call this method.
这篇关于将批量用户添加到AD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!