Deletes the zone object from Active Directory.
To delete a zone, you must have the DeleteSubTree privilege on the zone’s parent container. For example, to delete a zone from the default location for new zones, you must have the right to DeleteSubTree allowed on the domain/Program Data/Centrify/Zones container object.
Delete may throw one of the following exceptions:
- UnauthorizedAccessException if you have insufficient access rights to delete the zone.
- 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.
The following code sample illustrates using this method in a script:
... 'Specify the zone you want to work with set objZone = cims.GetZone("ajax.org/UNIX/Zones/test_lab") 'Delete the zone object objZone.Delete ...