Archive

Archive for April, 2010

CRM 4: IFD Authentication using C#

April 14th, 2010

A very common question is: “How do i run a plugin/custom web application against a IFD deployment?”

You should use the below code:

CrmDiscoveryService disco = new CrmDiscoveryService();
disco.Url = "https://YOUR.IFD.URL/MSCRMServices/2007/SPLA/CrmDiscoveryService.asmx";
RetrieveOrganizationsRequest orgRequest = new RetrieveOrganizationsRequest();
orgRequest.UserId = @"username";
orgRequest.Password = "password";
RetrieveOrganizationsResponse orgResponse = (RetrieveOrganizationsResponse)disco.Execute(orgRequest);
OrganizationDetail orgInfo = null;
foreach (OrganizationDetail orgdetail in orgResponse.OrganizationDetails)
{
   if (orgdetail.OrganizationName.Equals("OrgName"))
   {
   orgInfo = orgdetail;
   break;
   }
}
if (orgInfo == null)
{
   throw new Exception("The specified organization was not found.");
}
RetrieveCrmTicketRequest ticketRequest = new RetrieveCrmTicketRequest();
ticketRequest.OrganizationName = orgInfo.OrganizationName;
ticketRequest.UserId = @"username";
ticketRequest.Password = "password";
RetrieveCrmTicketResponse ticketResponse = (RetrieveCrmTicketResponse)disco.Execute(ticketRequest);

CrmAuthenticationToken sdktoken = new CrmAuthenticationToken();
sdktoken.AuthenticationType = 2;
sdktoken.OrganizationName = orgInfo.OrganizationName;
sdktoken.CrmTicket = ticketResponse.CrmTicket;
CrmService service = new CrmService();
service.CrmAuthenticationTokenValue = sdktoken;
service.Url = orgInfo.CrmServiceUrl;

Code: ifd-service-auth-code.txt

MSCRM-Admin CRM 4.0, Plug-ins , , ,

Backup and restore your SharePoint website using SharePoint Designer

April 14th, 2010

Found this PDF on how to backup and restore your SharePoint (SPWeb) website using SharePoint Designer: backup-restore-share-point-2007.pdf

Kudos to the Creator of the PDF.

MSCRM-Admin Sharepoint , , ,