Click here to Skip to main content
15,900,500 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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,
Posted
Updated 22-Feb-12 23:49pm
v2
Comments
OriginalGriff 23-Feb-12 4:36am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, read your homework instructions, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
BobJanova 23-Feb-12 5:32am    
What is AD?
tarek2012 23-Feb-12 5:37am    
MS Active directory

1 solution

So write a method that loads the csv file, loop through each line and within the loop call this method.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900