   [.net] Making multiple changes to an Active Directory user in one pass
  Currently, I'm trying to update our Active Directory student accounts. My code is as follows.oRow is a DataRow object  SearchResult result = search.FindOne();    if (result != null)    {   DirectoryEntry user = result.GetDirectoryEntry();   if (user.Properties["employeeNumber"].Value == null)  user.Properties["employeeNumber"].Add(HashSSN(oRow["SSN"].ToString()));    if (oRow["First_Name"].ToString() != user.Properties["givenName"].ToString())  user.Properties["givenName"].Value = oRow["First_Name"].ToString();   if(oRow["Last_Name"].ToString() != user.Properties["sn"].ToString())  user.Properties["sn"].Value = oRow["Last_Name"].ToString();   if (oRow["Middle_Init"].ToString() != user.Properties["initials"].ToString())  user.Properties["initials"].Value = oRow["Middle_Init"].ToString();   if (oRow["Dorm_Ext"].ToString() != user.Properties["telephoneNumber"].ToString())  user.Properties["telephoneNumber"].Value = oRow["Dorm_Ext"].ToString();   if (HashSSN(oRow["SSN"].ToString()) != user.Properties["employeeNumber"].ToString())user.Properties["employeeNumber"].Value = HashSSN(oRow["SSN"].ToString()); user.CommitChanges();Now, if I do this, it throws an exception that says "Only one type of operation can be performed in a sequence."Is this an AD limitation? Is there a good way around it?   
  I solved it.It is a limitation of Active Directory.You must write several loops to do one operation at a time.   