Commit

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

Syntax

void Commit()

Discussion

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

Exceptions

Commit may throw one of the following exceptions:

  • ApplicationException if any field in the UNIX profile is not valid.

  • COMException if an LDAP error occurs. LDAP errors can occur if the connection to the LDAP server fails, the connection times out, invalidcredentials are presented, or there are other problems communicating with Active Directory.

  • UnauthorizedAccessException if you have insufficient access rights to commit changes to the Active Directory object.

Example

The following code sample illustrates using Commit in a script:

...  
'Get the zone object  
Set objZone = cims.GetZone("ajax.org/UNIX/Zones/pilot")  
'Get the user object  
set objUser = cims.GetUserByPath("LDAP://CN=pat.hu,CN=Users, DC=ajax,DC=org")  
'Add the UNIX profile for the user  
set objUserUnixProfile = objUser.AddUnixProfile(objZone, 623, "pat_hu",
"/bin/bash", "/home/pat_hu", 623)  
'Enable the user’s UNIX profile  
objUserUnixProfile.UnixEnabled = True  
'Update Active Directory  
objUserUnixProfile.commit  
...