Saturday 24 September 2011

CRM 2011, using IFD organisation service from code

IFD organisation
url = @"https://org.domain.com/XrmServices/2011/Organization.svc";
username = @"domain\username";
password = "pass123";


ClientCredentials credentials = new ClientCredentials();
            credentials.UserName.UserName = username;
                credentials.UserName.Password = password;

                Uri organizationUri = new Uri(url);
                Uri homeRealmUri = null;

                OrganizationServiceProxy orgService = new OrganizationServiceProxy(organizationUri, homeRealmUri, credentials, null);

OrganizatinoResponse response = orgService.Execute(new WhoAmIRequest());

orgService.Dispose();


No comments:

Post a Comment