Tuesday, March 19, 2013

Deploying People Search - SharePoint 2013

Now that we have configured the Search Service Application and created the search center next up is deploying people search. Here is how it goes.

Step 01 - Grant Access for an account to crawl the profile store

Navigate to Manage Service Applications in the Application Management. Click to highlight the Search Service Application. Click on the “Administrators” in the ribbon. When the dialog box pops up, add the intended user account.  Make sure the user has permissions to Retrieve People Data for Search Crawlers. Click "OK" when done.


                                                                                                                                                           
                                                               
Step 02 - Create crawl rule

Navigate to create a new crawl rule (Search service application > click Crawl Rule > New Crawl Rule).

The quick launch in the search service application page contains the link.

[search service application page quick launch]


[Manage Crawl Rules page]

Provide the path to the start address of user profile service application. The format would be sps3://<hostname> where host name is the URL for the web application in which the My Sites site collection is deployed.

Select “Include all items in this path”

In the authentication section you can either keep the default content access account or provide the one you gave administration permission. This basically depends on your requirement. In order to give authentication for the user which you prefer, select "Specify a different content access account"  and provide account name and password.

Note that the "Do not allow basic authentication check box is selected by default". This allows user credentials to be encrypted before sending, which is the preferred approach unless you are using SSL to encrypt traffic.




                                                                                                                                                                                                  
Step 03 – Remove the profile store URL from the default content source
Navigate to Manage Content Source page. Click on the default content source "Local SharePoint site" which was created by default.

In the Start address list, remove the URL for the profile store ( sps3://<hostname> ) and click "OK".

Step 04 – Create a content source to crawl the profile store

In the "Manage Content Sources" page click "New Content Source"
  • Type crawl name
  • Provide Start address in the format sps3://<hostname>
  • Select "Crawl everything under the hostname for each start address"
  • You can choose between the continuous and incremental crawl depending on your business requirement.
    •  If you are specifying the incremental crawl, setup a schedule for it.
  • Set the content source priority.
  • Click "OK"


Now the configuration is done ! User profile crawl is independent of the local sharepoint site crawl.

Make sure the user profile synchronization is setup (this is discussed in an earlier post.)

As for the first time, you can click on the drop down arrow of the newly create Profile Store content source, and start a full crawl.



Once the crawl is done you can go to the search center and try out the people search.


Sunday, March 17, 2013

Creating a Search Center - SharePoint 2013

This post is a walk through to create a search center in SharePoint 2013

Site creation Steps


In central admin go to Application Management and select Create site collections. Note that the search center is the top level site of a site collection.

In the Create Site Collection page:

  1. Select the web application
  2. Type in the Title & description
  3. Specify the URL for the search center
  4. In the template selection, click on the Enterprise tab

If you are using SharePoint foundation 2013, select Basic Center template else
If you are using SharePoint Server 2013, select Enterprise Search Center template













Specify the primary and secondary administrators


Specify the primary and secondary administrators
In the quota template, select "No Quota" (The search center site is not meant to be a data repository, hence no quota is needed)
Then Click “OK”

The site is created !!


Permissions

In order to grant permissions for the users navigate to the search center site, and click on the Settings gear on the top right hand corner of the site. Select "Shared with…"




In the shared with dialog click on "Invite people link"
When the "Share" dialog appears specify "NT Authority\authenticated users" under "Invite People to Read"
Set the permission level give "Read" access





Update My Site Settings

Go to the My site settings page (Navigation: Central Admin > Manage Service Applications > User Profile Service Application > Setup My Sites). 
In the preferred search center section provide the URL for the created search center. This will allow searches carried out from my site profile page to use the created search center.







SharePoint 2013 Search Service

I would like to blog a bit of what I know on the SharePoint 2013 search in the coming posts. Will start off by creating the search service. So here are the steps.

Step 01 - Creating the search service

In the central admin page, select “Manage Service Applications” under Application Management.
Then, in the Service Applications tab, select “New” drop down and select, “Search Service Application”























                                                                                                                                                                                                     
In the create dialog specify:
  1. Search Service application name
  2. Specify the service account
  3. Application pool for Search Admin Web Service
    • Specify the security account
  4. Application pool for Search Query and Site Settings Web service
    • Specify the security account 
Once the search service is created you will be able to see the search administration service along with the search service in the servises listing.






                                    
Step 02 - Configure

Specify the default content access account. By default the name you specify at search service creation is set as the content access account.






















Step 03 - Create Content Sources

When the Search service application is created a content source named “Local SharePoint sites” is created. This is configured to crawl all sites in the local farm.
To create a new content source in the Search service application, click content sources and select “New Content Source”.


Provide:
1 Content source name
2 content source type
3 addresses one below the other
4 Crawl schedule (Full and incremental)
5 content source priority























                                                                                                                        
                                              
Step 04 - Set Crawl rules
Crawl rules can be explicitly set for either exclude or include site from the crawl.




Monday, March 11, 2013

Creating a Simple WCF in Visual Studio 2012

In this post I would like to explain on how to create a simple WCF using Visual Studio 2012 and deploy to the IIS server.

Step 01
Create a WCF Project. ( File > New > Project > WCF >WCF Service Application ). Select WCF Service Application and give a name.



                                                               
                                                                                                                                                   
Step 02
The Solution will include a WCF Service created by default. Let's delete this and create a new from scratch. You need to delete the files Service1.svc and IService1.cs.

Step 03
Create a new WCF service. Right click on the project, select "Add", then select New Item. In the Add New Item Window select "WCF Service" and provide a name for the service.


                                                                                                                                                                                                                                                                           
Step 04
Define the operation contract in the interface as the below example:
















                                                                                                                                                    
Step 05
Add the method and the logic in the service class and build the solution. (in SimpleService.svc.cs)
























                                                                    
Please note that I have used simple exception handling instead of the fault contract for simplicity.

Step 06 - Creating a site
Open the IIS Manager (In start menu select "Run" and type "inetmgr")
                                                     
Create an application pool















                                                                                                             
Create a site. You can specify the application pool to use.  

























                                                                                                                 
                                                                                   
Step 07 - Deploy Solution

In the solution explorer, right click on the project and select "Publish".



















                                                                                                                    

Click on the "Preview" button to check on the publishing actions to the files:




















                                                                                                         
Once the solution is published, you can check the service availability












  
                                                                                                        
Now the Service is ready for use.

Testing the Service

You can test the service functionality using the Visual Studio 2012 Developer command prompt. In the command prompt, type "wcftestclient".


                                                                                                                                                                                                   
In the WCF test client, right click on the "My Service Projects" and select "Add Service"
















                                                                                                                                                            
Insert the path for the service URL and select "OK".









                                                                                                             
The client opens up the service methods, double click on GetAverage(). Insert the values to the parameters and click "Invoke". You will get the resulting value.

Thursday, March 7, 2013

User Profile Synchronization - SharePoint 2013

 This post is related to the My Site creation described in the earlier post.

Step 01
Once the user profile service is provisioned the Forefront identity manager services will be visible in your server. Go to Server Manager > Configuration > Services.
Note that the startup type of the services should be set to automatic. Include a SharePoint farm account as the Log On user.











Step 02
In the Central Admin you will be able to see the "User Profile Service" and the "User Profile Synchronization Service". Navigate to Application Management > Manage Services on Server

 
                                                                                                                                                            
In Case you don't have a user profile service, navigate to "Manager Service Applications" available under "Service Applications" and create a new user profile service application.
























                                                                                                                                                                       

Step 03 - Configure Synchronization Settings

Navigate to "User Profile Service Application" (Application Management > manage Service Application > User Profile Service Application).



Select "Configure Synchronization Settings" under "Synchronization". There are three options available for the Synch.

1) Use SharePoint Profile Synchronization - For full featured SharePoint Profile Synchronization
2) Use SharePoint Active Directory Import - For light-weight Active Directory Import option (with some limitations)
3) Enable External Identity Manager - To use an external identity manager for the Profile Sync

I have selected option one.

Step 04 - Configure Synchronization Connections

In the "Synchronization Connections" page create a new connection. 

In the new connection page:
  • Specify Connection name
  • Insert the forest name. ( Eg. CompanyName.com )
  • Users have the option to choose between auto discover domain name and explicitly specify.
  • Set authentication provider type &
  • Populate containers and select the profiles to synch
  • Finally click ok

Step 05 - Configure Incremental Synchronization

In the "Configure Synchronization Timer Job" page, set the date and time for incremental synch


Step 06 - Full Profile Sync

In the "Start Profile Synchronization" page select "Start Full Synchronization" and click ok. The Full Synch will start the status will be displayed on the "User Profile Service Application" page.

Wednesday, March 6, 2013

Creating a MySite Host in SharePoint 2013

This is a simple step by step guide to create a My Site Host in SharePoint 2013.

Initially, create a Web Application:


In the Create Web Application page, specify whether to use an existing IIS web site or create a new

Specify authentication type


You can either choose an existing application pool or specify a new. Its best that the database name and the new application pool name  is changed to a readable format. For an example DB name could go as WSS_Content_SiteName

Click ok and the web application will get created. Next step is to create the site collection. When the web application is created the page provides an option to create a site collection. In the create site collection page, user has to select the site template. Choose "My Site Host" under Enterprise tab.
Now the "MySite Host" is created. It is required to add a managed path for the ease of personal site creations for the users.
In the web application list select the web application dedicated to the my site. Select managed paths and add a managed path. Eg: "personal".


The final step would be to set up the My Site. Go to the user profile service application. Select "Setup My Sites" which is under "My Site Settings". In the My Site settings page change the "My Site Host location" to the created My Site Host url.

In the "Personal Site Location" section provide the managed path specified in the earlier step.

The "Site Naming Format" is used to define the personal site naming format


Tuesday, March 5, 2013

Understanding SharePoint Replication Engine - User Profile Recovery

Once the full user profile replication is executed via the replication engine, a folder is  created in the log file location with the prefix Full_. The full replication summary is displayed at the end as below:





















The engine maintains the below files to track status of replication.



Full_Err_Push.log :                      Maintains the exceptions during the process
Full_Err_Push_ProfileIndex.log : Contains the Profile Indexes belonging to the failed user profiles.
Full_Instrumentation.log :            Contains the successfully replicated profile names, including index and the timestamp

Full_Err_Acct.rcv :                     Contains the failed user profile list in the <Domain>\<ProfileName> format. One record per row.


According to the result above there are 595 failed profiles. The SharePoint user profile replication engine has the capability to recover the replication failures which occurred during the full replication.

The command for recovery is Start-SPProfileServiceRecoveryReplication
The format of the command would be:

Start SPProfileServiceRecoveryReplication destination <String> Filename <String> source <String> [-DoSocialReplication <SwitchParameter>] [-DoUpgrade <SwitchParameter>] [-EnableInstrumentation <SwitchParameter>] [match <SwitchParameter> subtype] [-Properties < String []>] [timeout <Int32>]

The recovery needs to find out the failed user profile list, which is included in the Full_Err_Acct.rcv file. 

For an instance we can use the command as :

Start-SPProfileServiceRecoveryReplication -Source http://FarmA/mysitehosturl/ -Destination http://FarmB/mysitehosturl/ -FileName "C:\Program Files\Microsoft\SharePoint 2010 Administration Toolkit\Replication Engine\log\Full_634977620010414201\Full_Err_Acct.rcv" -EnableInstrumentation -DoSocialReplication

On executing the recovery, a folder is created in the log which is prefixed by Recovery_. In it contains the log files pertaining to the recovery process.

Sunday, March 3, 2013

Experiencing SharePoint User Profile Replication Engine

Hi All,

I’m using SharePoint Server 2010. There are three SharePoint farms having their own my site hosts. Each my site host uses its own User Profile Service Application. Each farm is set to synchronize user profiles from the active directory. Due to its structuring the need to geo replicate the user profiles has risen. So here is the approach I used.

The Audiences has to be set and compiled in each farm. Since the audience is compiled in a periodic manner (E.g. Weekly), no need to worry about new additions to the audiences. Trusted host locations has to be configured in each farm.



Initially a full replication is executed.
The log files available in the “C:\Program Files\Microsoft\SharePoint 2010 Administration Toolkit\Replication Engine\log” location can be used to troubleshoot errors during replication.
The incremental replication is the tricky one. The replication is carried out as depicted in the below diagram.



In order to replicate to multiple farms the destination my site host url’s can be comma separated. For an instance the command could be as below:

$mycredential = Get-Credential
get-spprofilepropertycollection –source http://FarmA_MySiteHostUrl | start-spprofileserviceincrementalreplication -source http:// FarmA_MySiteHostUrl -destination http:// FarmB_MySiteHostUrl,http:// FarmC_MySiteHostUrl  -EnableInstrumentation -Credential $mycredential


And the deed is done !

In the “log” folder you will be able to see two new folders created as Inc_UPS_Farm-B-MysiteHost-Url and Inc_UPS_Farm-C-MysiteHost-Url which holds logs on the incremental replication status and related errors.
Yet, one thing is to be noted. When a user profile image is changed in one farm the respective image gets changed in the other farms. But when the image is removed, the image doesn’t get removed in the other farms. Hopefully this will be resolved in future.
Feel free to add comments.

References:
http://technet.microsoft.com/en-us/library/ff823733(v=office.14).aspx

The same post is available in my blog http://shaamil.blog.com/.