RetrieveAllChildUsersSystemUser Message (CrmService)
![]() |
[Applies to: Microsoft Dynamics CRM 4.0]
| Works for all deployment types | Works online and offline |
Retrieves the collection of users that report to the specified system user (user).
The relevant classes are specified in the following table.
| Type | Class |
| Request | RetrieveAllChildUsersSystemUserRequest |
| Response | RetrieveAllChildUsersSystemUserResponse |
| Entity | systemuser |
Remarks
To use this message, pass an instance of the RetrieveAllChildUsersSystemUserRequest 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 RetrieveAllChildUsersSystemUser Privileges.
Example
The following code example shows how to use the RetrieveAllChildUsersSystemUser 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.
RetrieveAllChildUsersSystemUserRequest retrieve = new RetrieveAllChildUsersSystemUserRequest();
// Create the column set object that indicates the fields to be retrieved.
ColumnSet cols = new ColumnSet();
// Set the column set properties.
cols.Attributes = new string[] { "systemuserid", "domainname" };
// Set the column set.
retrieve.ColumnSet = cols;
// Set the ID of the parent user.
retrieve.EntityId = new Guid("18ECA720-493E-4800-BBFD-638BD54EB325");
// Execute the request.
RetrieveAllChildUsersSystemUserResponse retrieved =
(RetrieveAllChildUsersSystemUserResponse)service.Execute(retrieve);
[Visual Basic .NET]
' Set up the CRM service.
Dim token As 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"
Dim service As New CrmService()
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx"
service.CrmAuthenticationTokenValue = token
service.Credentials = System.Net.CredentialCache.DefaultCredentials
' Create the request object.
Dim retrieve As New RetrieveAllChildUsersSystemUserRequest()
' Create the column set object that indicates the fields to be retrieved.
Dim cols As New ColumnSet()
' Set the column set properties.
cols.Attributes = New String() {"systemuserid", "domainname"}
' Set the column set.
retrieve.ColumnSet = cols
' Set the ID of the parent user.
retrieve.EntityId = New Guid("18ECA720-493E-4800-BBFD-638BD54EB325")
' Execute the request.
Dim retrieved As RetrieveAllChildUsersSystemUserResponse = CType(service.Execute(retrieve), RetrieveAllChildUsersSystemUserResponse)
See Also
Concepts
Reference
© 2010 Microsoft Corporation. All rights reserved.

