RenameUser Method (PIUsers collection)

               

 

The RenameUser method changes the name of an existing PIUser on the Server and in the PIUsers collection.

 

Syntax

object.RenameUser OldName, NewName

The Rename method syntax has these parts:

Part

Description

object

An object expression that evaluates to a PIUsers collection.

OldName

A string containing the name of the existing PIUser to be renamed as obtained from the PIUser.Name property.

NewName

A string containing the new name for the PIUser.

 

Remarks

Programs should exercise caution when changing the name of a PIUser as it may impact users who expect to log on to a Server using the old name. Server resources owned by the user do not change due to the rename.

 

Trappable Errors

In addition to generic errors (such as Out of Memory), the following errors may occur:

Error

Description

pseACCESSDENIED

Caller does not have sufficient privilege to modify a PIUser.

pseNOEMPTYSTRINGS

Both the oldName and the newName must be non-blank.

pseUSERNOTFOUND

The passed oldName does not exist on the server.

pseUSERRENAME

Unable to rename the user on the server. See the error description for more information.

Enabling Operational Intelligence