AddUser

Adds a user to this computer role.

Syntax

IAzRoleAssignment AddUser(DirectoryEntry user)
IAzRoleAssignment AddUser(SearchResult userSr)
IAzRoleAssignment AddUser(string userDn)
IAzRoleAssignment AddUser(IADsUser userIads)

Parameters

Specify one of the following parameters when using this method.

Parameter Description

user

The directory entry for the user you want to add.

userSr

The directory entry for a user specified as a search result.

userDn

The user specified as a distinguished name.

userIads

The IADs interface to the user.

Return value

The computer role assignment that includes the new user.

Discussion

The AddUser(DirectoryEntry user) and AddAccessGroup(SearchResult user) methods are available only for .NET-based programs. Call AddRoleAssignmentfor VBScript.

Exceptions

AddUser may throw one of the following exceptions:

  • ArgumentNullException if the specified parameter value is null.
  • ApplicationException if the parameter value is not a valid user or if it failed to create a role assignment because it cannot find the user.