How to access all other user’s personal site collections in Office 365 SharePoint 2010

July 18, 2013 1 comment

The Global admin has the super permission to access all other users’ personal site in SharePoint 2010 Office 365.

When a user leave business and then, Global admin can get into that user’s profile and personal site collections and can be accessed or a  role based user (e.g reception, account manager) account could be transferred to the new user. Please follow the steps below:

Need to login as SharePoint 2010 Office 365 Global Admin then navigate to SharePoint “administration center” => Manage “User Profile” => find the user.

Then need to add an Global user into the selected user’s site collection administration list then after that Global admin can have access to the selected owner’s personal site collection.

click the Inverted triangle beside account name:

1. manage site collection owners => add Global Admin into site collection administration List
2. manage personal site => then Global user will be able to enter the user’s personal site collection.

access all other user's personal site collection setup steps

access all other user’s personal site collections setup steps

Advertisements

Testing SMTP send email code on Localhost using smtp4dev without having SMTP server setup

June 21, 2013 1 comment

Another useful software smtp4dev

smtp4dev is for Windows 7/ Vista/XP/2003/2010 compatible dummy SMTP server. This can be use for the SMTP send email testing of development project on local machine. It is useful for testing / debugging software that generate email without having SMTP server setup.

Email won’t be delivered physically to the recipient but smtp4dev will listen the local port and capture the record of the email message details. Message can inspect of its source , Header and Body and also we can open message on outlook to see the content of it just double click on received the message by smtp4dev.

Download from http://smtp4dev.codeplex.com/

smtp4dev runnning window

smtp4dev running window listening local port and capturing messages

smtp4dev messages on outlook

smtp4dev email message open on Outlook

Dynamics CRM 2011 FetchXML result convert to XML file

We would walk through the steps how to retrieve data from Microsoft Dynamics CRM 2011 executing FeatchXML query and convert to xml file.

1. XML query string of FetchXML.
2. Create Organisational Services proxy.
3. Use IOrganizationService.RetrieveMultiple method to execute the query string.
4. Create XML Document Object to put the set of fetchXML records.
5. Foreach loop through the result and Build the XML node.
6. Convert to XML file and save in hard drive.


// 1. XML query string of FetchXML.

string fetchXml = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' count='100'>
<entity name='account'>
<attribute name='ownerid' />
<attribute name='name' />
<attribute name='accountnumber' />
<attribute name='accountid' />
</entity>
</fetch>";

// 2. Create Organisational Services proxy

OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(OrganizationUri, HomeRealmUri, Credentials, null);

IOrganizationService _orgService = (IOrganizationService)serviceProxy;
serviceProxy.Authenticate();

// 3. IOrganizationService.RetrieveMultiple method to execute the query string
EntityCollection fxResult1 = _orgService.RetrieveMultiple(new FetchExpression(fetchXml));

// 4. create XML Document Object to put the set of fetchXML records
XmlDocument xml = new XmlDocument();

XmlDeclaration xmlDeclaration = xml.CreateXmlDeclaration("1.0", null, "yes");
XmlElement root = xml.CreateElement("accounts");
xml.InsertBefore(xmlDeclaration, xml.DocumentElement);
xml.AppendChild(root);

// 5. Foreach loop through the result and Build the XML node

foreach (var e in fxResult.Entities)
{
XmlElement child_root_table = xml.CreateElement("Table1");
root.AppendChild(child_root_table);

XmlElement child_name = xml.CreateElement("name");
child_name.InnerText = e.Attributes["name"].ToString();
child_root_table.AppendChild(child_name);

XmlElement child_accountid = xml.CreateElement("accountid");
child_accountid.InnerText = e.Attributes["accountid"].ToString();
child_root_table.AppendChild(child_accountid);

XmlElement child_accountnumber = xml.CreateElement("accountnumber");
child_accountnumber.InnerText = e.Attributes["accountnumber"].ToString();
child_root_table.AppendChild(child_accountnumber);

XmlElement child_creditonhold = xml.CreateElement("creditonhold");
child_creditonhold.InnerText = e.Attributes["creditonhold"].ToString();
child_root_table.AppendChild(child_creditonhold);

}

// 6. Convert to XML file and save in hard drive.
string fetchXmlOutput = xml.OuterXml;
StringReader xmlst = new StringReader(fetchXmlOutput);

XmlDocument XDoc = new XmlDocument();

XDoc.LoadXml(fetchXmlOutput.ToString());
XDoc.Save(@"c:\\fetchxml-records.xml");

Sample Output XML file:

crm2011-fetchxml-records

Retrieve Microsoft CRM 2011 data using FetchXML query and web service

The following sample demonstrates how to retrieve Microsoft Dynamics CRM 2011 On-premise records using FetchXML. The sample performs the following steps:

– Creates a Windows form Application on Visual Studio 2012 using C#.
– Download Microsoft Dynamics CRM 2011 Software Development Kit (SDK) and add References
– Make a connection to the Microsoft Dynamics CRM providing windows authentication.
– Retrieves the contact from Microsoft Dynamics CRM 2011.
– Create new record to the Microsoft Dynamics CRM 2011.

1. Create a windows Form application project on visual studio:

create-win-project

2. Download Microsoft Dynamics CRM 2011 Software Development Kit (SDK):

Download Microsoft Dynamics CRM 2011 Software Development Kit (SDK) from the link below
http://www.microsoft.com/en-us/download/details.aspx?id=24004
extract the downloaded MicrosoftDynamicsCRM2011SDK file. add the References from the bin folder to the project.

3. Windows Identity Foundation install to for Windows 7:

Windows Identify Foundation Pack installed on Windows 7 machine from link below
http://www.microsoft.com/en-us/download/details.aspx?id=17331

Note: you would get an error message on runtime below if you dont have installed.

Could not load file or assembly ‘Microsoft.IdentityModel Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencie. The system cannot fine the find specified.

4. Add References to the project:
SDK References:

microsoft.crm.sdk.proxy
microsoft.xrm.client
microsoft.xrm.sdk

System References:

System.Configuration
System.Runtime.Serialization
System.ServiceModel

5. Add Namesapces

a) System Namespaces

using System.Configuration;
using System.IO;
using System.Xml;

using System.Windows.Forms;
using System.ServiceModel.Description;
using System.Web.Services.Protocols;

b) SDK Namespaces

using Microsoft.Crm.Sdk;
using Microsoft.Crm.Sdk.Messages;

using Microsoft.Xrm.Client;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Sdk.Messages;
using Microsoft.Xrm.Sdk.Discovery;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Client.Services;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Crm.SdkTypeProxy;

6. create the connection to the Organization service

Authenticate using credentials of the logged in user;

Note: for the on-premise CRM 2011 need to get windows Authentication


ClientCredentials Credentials = new ClientCredentials()
System.Net.NetworkCredential network = new System.Net.NetworkCredential
{
UserName = "username",
Password = "password",
Domain = "your network domain"
};
Credentials.Windows.ClientCredential = network;

//assign Organization url.
Uri OrganizationUri = new Uri(“http:/<servername>/:5555/<orgname>/XRMServices/2011/Organization.svc”);
Uri HomeRealmUri = null;

Create Organisational Services Proxy to the CMS 2011

OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(OrganizationUri, HomeRealmUri, Credentials, null);

IOrganizationService _orgService = (IOrganizationService)serviceProxy;
serviceProxy.Authenticate();

7. create FetchXML query string:

we could build FetchXML query from the Dynamics CRM 2011 and download it on local drive.

create-fetchxml-query

Create the FetchXml string for retrieving all child accounts to a parent account.We can create the FeatchXml string from CMS 2011 aqnd save it to local to use in here. in this sample we are only retrieving 100 records.


string fetchXml = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' count='100'>
<entity name='account'>
<attribute name='ownerid' />
<attribute name='name' />
<attribute name='accountnumber' />
<attribute name='accountid' />
<order attribute='accountnumber' descending='true' />
<link-entity name='systemuser' to='owninguser' alias='mainuser'>
<attribute name='systemuserid'/>
<attribute name='domainname' />
<attribute name='fullname' />
</link-entity >
</entity>
</fetch>";

Excute the fetch query and get the xml result from the Organisational Proxy

EntityCollection fxResult = _orgService.RetrieveMultiple(new FetchExpression(fetchXml));

When FetchXML query get executed by using the RetrieveMultiple method, the return values are an EntityCollection that contains the results of the query, then the foreach loop could be useed to iterate through the result collection of the FetchXML query.


foreach (var e in fxResult.Entities)
{
Console.WriteLine("Name: {0} , accountid: {1}", e.Attributes["name"].ToString(), e.Attributes["accountid"].ToString());

}

Account records on Dynamics CRM 2011 below:

crm-account-list

XML format of the FetchXML records Collection below:

fetchXML-records

My farewell in FIS

I had a very good farewell in Funding Information Services (FIS) when i moved to the new role. I enjoyed much working for FIS and the people on that office floor. I love my watch as a gift..

See “Farewell to Prabir” >>

BIT students help make Tonga’s roads a safer place

Tonga’s paper-based driver licensing system is set to be a thing of the past thanks to a team of Bachelor of Information Technology students from the Otago Polytechnic’s School of Information Technology & Electrotechnology.

Siaosi Napualani Vaka, Chad Roulston and Prabir Choudhury have been working towards creating a new computerised system for the Tongan police department. The completed product will store driver details, produce printed licence cards, and offer computer-based driver theory tests.

see more >>

Install multiple versions of IE on your PC

Ever wanted to test your website in various versions of Internet Explorer?

It is possible to run Internet Explorer in standalone mode without having to over-write previous versions thanks to Joe Maddalone who came up with a way of achieving that in November 2003. Basically, Internet Explorer is run by exploiting a known workaround to DLL hell – which was introduced in Windows 2000 and later versions – called DLL redirection.

More >>