ModifyAccount

Security Manager Module

Description: Used to change any of the elements of an account definition that may be modified.
Returns: Object value
Usage: Script Only.
Related to: AddAccount | DeleteAccount
Format: \SecurityManager\ModifyAccount (NewAccountData [, PtrReturnCode, HaveLock]);
Parameters:  
NewAccountData
Required. An AccountData structure, a single dimension array of AccountData structures or a dictionary of AccountData structures containing the data to modify in each account.
PtrReturnCode
Optional. A pointer to a value that will contain one of the defined result codes at the conclusion of the operation.
HaveLock
Optional. A Boolean value that indicates whether the working copy lock is held by the calling code. Default FALSE.
Comments:

To use this API, the calling code must be running in a security session that has Manager privilege.

Modifying an account is an asynchronous operation. If the asynchronous operation was not attempted, due to detection of an error, the return value will be Invalid. If the asynchronous operation is attempted, the return value will be an object value. The object value will become Invalid when the asynchronous operation completes. At that time (or when the method returns Invalid), the value addressed by PtrReturnCode can be examined to determine the status of the operation. The contents of the value addressed by PtrReturnCode is undefined until the method returns Invalid.

A single account can be modified by supplying a single AccountData structure in NewAccountData. Multiple accounts can be modified in one operation by providing a single dimension array or dictionary of AccountData structures in NewAccountData.
The result code returned in the value addressed by PtrReturnCode will be a scalar value if a single structure was supplied in NewAccountData. If an array of structures or a dictionary of structures was supplied, a single dimension array of the same size as NewAccountData will be returned in the value addressed by PtrReturnCode, each element containing the result code for the corresponding NewAccountData element.

Modifying an account requires a working copy write lock. If such a lock is held by the calling code, the HaveLock parameter must be set to TRUE. Otherwise omit this parameter or set it to FALSE. If the calling code holds a read lock on the working copy, this must be released before ModifyAccount can complete its operation.
The AccountData structure(s) provided must have the AccountID member set to an existing account ID.

Any other member of the structure can be Invalid, in which case no change is made to that member of the account record. Only valid members cause modification.
If the password is being changed, the new password must meet application password strength settings. On return the Password member is not erased. It is highly recommended that calling code be careful to ensure that unencrypted passwords are destroyed as soon as possible after completion of this operation.