Commit

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

Syntax

void Commit()

Discussion

When you use this method, it checks and validates the computer properties before saving the object in Active Directory. For example, before saving, the method validates that the computer name doesn’t exceed the maximum length or contain invalid characters.

Exceptions

Commit may throw one of the following exceptions:

  • ApplicationException if the changes you are attempting to save contain one or more errors.

  • 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.

  • InvalidOperationException if the computer profile cannot be found. This usually indicates that the computer is not in a zone.

  • UnauthorizedAccessException if there are insufficient permissions to commit the Active Directory computer account object.

Example

The following code sample illustrates using Commit for a computer object in a script:

...  
set objZone = cims.GetZone("sierra.com/Performix/Zones/HongKong")  
'Identify the computer account  
Set objComp = cims.GetComputer("sierra.com/Performix/Computers/chu”)   
'Set a property and save the changes to the computer account  
Set objComp.WebSphereEnabled = true  
objComp.Commit  
...