Commits any changes or updates to the group object and saves the changes to Active Directory.


void Commit()


When you use this method, it checks and validates the data before saving it in Active Directory. Before saving, the method validates the following:

  • The group name is a valid string that contains only letters (upper- or lowercase), numerals 0 through 9, and the hyphen (-) and underscore (_) characters.
  • The GID value is a positive integer. Negative numbers are not allowed.
  • The group name does not duplicate an existing group name.


Commit may throw one of the following exceptions:

  • ApplicationException if any field in the UNIX group profile is invalid.
  • COMException if an LDAP error occurs. LDAP errors can occur if the connection to the LDAP server fails, the connection times out, invalid credentials are presented, or there are other problems communicating with Active Directory.
  • UnauthorizedAccessException if you have insufficient permissions to commit the group object to Active Directory.


The following code sample illustrates using Commit in a script:

if (objGroup.UnixProfiles.Find(objZone) == null)
    Console.WriteLine( strGroup + " was not a member of " + strZone);
    // Remove group