RetrievePrivilegeSet Message (CrmService)
![]() |
[Applies to: Microsoft Dynamics CRM 4.0]
Find the latest SDK documentation: CRM 2015 SDK
| Works for all deployment types | Works online and offline |
Retrieves the set of privileges defined in the system.
The relevant classes are specified in the following table.
| Type | Class |
| Request | RetrievePrivilegeSetRequest |
| Response | RetrievePrivilegeSetResponse |
| Entity | privilege |
Remarks
To use this message, pass an instance of the RetrievePrivilegeSetRequest class as the request parameter in the Execute method.
To perform this action, the caller must have access rights on the entity instance specified in the request class. For a list of required privileges, see RetrievePrivilegeSet Privileges.
Example
The following code example demonstrates how to use the RetrievePrivilegeSet 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.
RetrievePrivilegeSetRequest retrieve = new RetrievePrivilegeSetRequest();
// Execute the request.
RetrievePrivilegeSetResponse retrieved = (RetrievePrivilegeSetResponse)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.
Dim retrieve As New RetrievePrivilegeSetRequest()
' Execute the request.
Dim retrieved As RetrievePrivilegeSetResponse = CType(service.Execute(retrieve), RetrievePrivilegeSetResponse)
See Also
Concepts
Reference
.gif)