+91-90427 10472
         
Dot net training in Chennai

Create Search Service application in SharePoint

Document by Ganesanva@hotmail.com – + 919042710472

Go to Central Administration
Navigate to Application Management -> Manage Service Applications
Click on New -> Search Service Application as shown

Fill the Pop up as shown below.


Search Service Application 11 will be created as shown below.

Select the “Search Service Application” and Click on “Manage” in top ribbon.
Next -> Click on Content Sources.

Click on the link “Local SharePoint Sites”.
Type the web application that need to be crawled in the Start Addresses text box.


Click on Create Schedule on Full Crawl.
Enter the schedule details as below.

Click on Create Schedule in Incremental Crawl. Enter the details as below.

Check box the Start Full Crawl of this Content Source.

Click OK.
The site will now get crawled and all the Search content in Content database will be now moved on to the Search database.

Once the Crawling gets completed, the status will change to “Idle”.
Go on to the site that is crawled and in Home page you can find the search box which allows to search based on Crawling.

Enter employee in Search this site text box and press enter.
The search result will be shown as below in “/_layouts/OSSSearchResults.aspx” URL.

It allows to filter the search in various options and allow to create Custom scope for the search within the site collection.

CRUD operation in SharePoint using Power shell commands

Document by Ganesanva@hotmail.com – + 919042710472

Create a List “EmployeeList” with below columns.

The List looks as below,

Create a power shell script CRUD.ps1 with below code,

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$web = Get-SPWeb http://htc:7004/
$list = $web.Lists[“EmployeeList”]
$option = Read-Host ‘Enter Option 1.Create item 2.Update item 3.Read item’
if($option -eq 1)
{
#Create a new item
$newItem = $list.Items.Add()
$Title = Read-Host ‘Enter Title’
$EmployeeName = Read-Host ‘Enter Employee Name’
#Add properties to this list item
$newItem[“Title”] = $Title
$newItem[“EmployeeName”] = $EmployeeName
#Update the object so it gets saved to the list
$newItem.Update()
echo ‘item updation Done’
}
if($option -eq 2)
{
#Get all items in this list and save them to a variable
$items = $list.items
$Titlevalue = Read-Host ‘Enter Title value to update’
#Go through all items
foreach($item in $items)
{
#If the “Title” column value equals “My first item!” do something with it
if($item[“Title”] -eq $Titlevalue)
{
$Title = Read-Host ‘Enter Title’
$EmployeeName = Read-Host ‘Enter Employee Name’
#Change the value of the “Title” column
$item[“Title”] = $Title
$item[“EmployeeName”] = $EmployeeName
#Update the item
$item.Update()
}
}
echo ‘item updation Done’
}
if($option -eq 3)
{
$items = $list.items
#Go through all items
foreach($item in $items)
{
write-host “`n”
write-host “Title:”$item[“Title”]
write-host “Employee Name:” $item[“EmployeeName”]
}
}

Open Windows PowerShell ISE from Start menu.

If windows PowerShell ISE not found in start menu do the below steps.
Simply, go and add this feature:
add PowerShell ise: here is the steps:
Open Server Manager
2. Click the Features node
3. Click the Add Features link
4. Check the box for “Windows PowerShell Integrated Scripting Environment”.
5. Click Next, then Install
6. Wait until installation is complete
7. Open PowerShell ISE from Programs>Accessories>PowerShell folder
Open the CRUD.PS1 from File -> Open in Windows PowerShell ISE.

Output as below:
Click on the Play button.

Enter “1”

Click OK.

Click Ok.
The Output windows shows as below,

The item gets added in List as below,

Run again and select the Option “2”.


Checks for Title equals “Bing”


Now the item Bing gets updated to Google in the list.
Run the Script again and enter option “3”.

The output will be printed as below,

Click below to download the solution,
https://1drv.ms/u/s!ArddhCoxftkQg9VV49MnJI30l3tRsA