IOPLEX
Communications Software
Plexcel for PHP - Active Directory PHP Integration
plexcel_new
plexcel_status
plexcel_find_authorities_by_domain
plexcel_get_authority
plexcel_get_domain
plexcel_log
plexcel_preamble
plexcel_authenticate
plexcel_sso
plexcel_logon
plexcel_logoff
plexcel_accept_token
plexcel_is_member_of
plexcel_set_password
plexcel_change_password
plexcel_gen_service_keytab
plexcel_search_objects
plexcel_get_account
plexcel_add_object
plexcel_modify_object
plexcel_delete_object
plexcel_rename_object
plexcel_set_attrdefs
plexcel_get_attrdefs
plexcel_set_conv_attrdefs

plexcel_rename_object

Printer Friendly Format

Synopsis

bool plexcel_rename_object(resource $px,
          string $dn,
          string $newrdn,
          string $newparent)

Description

The plexcel_rename_object function renames and / or moves the object identified by the $dn parameter in the directory.

The $px parameter is the Plexcel context resource representing the directory binding and context specific options.

The $dn parameter is the full distinguished name of the object to be renamed.

The $newrdn is the new Relative Distinguished Name (RDN) of the object (e.g. "CN=Alice Baker").

The $newparent is the new base DN of the object after it is renamed. This parameter is optional and defaults to NULL. Meaning, if a $newparent parameter is supplied and is not NULL, the object will be effectively moved between containers.

Note: This function supports an optional 5th boolean parameter that indicates as to whether or not the old entry should be deleted. However, currently Active Directory does not support any value other than the default of TRUE.

Example

The following simple fragment of PHP illustrates how to rename an entry in the directory. It also uses the optional $newparent parameter to move the object to a new container.

$dn = 'CN=TS110,OU=Tést,DC=example,DC=com';
$newrdn = 'CN=PS110';
$newparent = 'OU=Prod,DC=example,DC=com';

        if (plexcel_rename_object($px, $dn, $newrdn, $newparent) == FALSE) {
      
    die('<pre>' . plexcel_status($px) . '</pre>');
}
echo 'The object was renamed successfully.';

Returns

The plexcel_rename_object function returns TRUE if the object was successfully renamed. Otherwise, FALSE is returned in which case plexcel_status should be consulted.

Example

plexcel_add_object | plexcel_modify_object | plexcel_delete_object

© 2008 IOPLEX Software | Contact Us | Policies