SetBusinessSystemUser Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

Works for all deployment types Works online only

Moves a user to a different business unit.

The relevant classes are specified in the following table.

Type Class
Request SetBusinessSystemUserRequest
Response SetBusinessSystemUserResponse
Entity systemuser

Remarks

To use this message, pass an instance of the SetBusinessSystemUserRequest class as the request parameter in the Execute method.

To perform this action, the caller must have access rights on the system user (user) entity instance. For a list of required privileges, see SetBusinessSystemUser Privileges.

Example

The following code example demonstrates how to use the SetBusinessSystemUser message.

[C#]
// Set up the CRM Service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
// You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0; 
token.OrganizationName = "AdventureWorksCycle";
 
CrmService service = new CrmService();
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create the request object.
SetBusinessSystemUserRequest user = new SetBusinessSystemUserRequest();

// Set the properties of the request object.
user.BusinessId = new Guid("97110FB7-84A1-DB11-BEB5-0013727B635D");
SecurityPrincipal assignee = new SecurityPrincipal();
assignee.PrincipalId = new Guid("59727AF6-09A0-DB11-BEB5-0013727B635D");
user.ReassignPrincipal = assignee;
user.UserId = new Guid("59727AF6-09A0-DB11-BEB5-0013727B635D");

// Execute the request.
SetBusinessSystemUserResponse assigned = (SetBusinessSystemUserResponse) service.Execute(user);

See Also

Concepts

Reference

© 2010 Microsoft Corporation. All rights reserved.