Sunday, 22 August 2010

Setting up the Search Service Application in PowerShell for SharePoint 2010

The below commands will do this, and avoid the horrible GUID's on the database names for the three Search databases that are created. You will need to amend the first few lines where indicated in RED. If you use different naming conventions then just adjust as required.

IMPORTANT NOTE: There is a character which is used in the below script on more than one occasion, that doesn't show on this blog!!!!! This is the breaker character, which looks like an 'I' and is normally located next to the left shift key.

Essentially you will not be able to copy the below, its more of a reference piece.

###################

$app = new-spserviceapplicationpool –name "SERVERNAME Search Application" –account Rob-Hardy\Search
$searchapp = new-spenterprisesearchserviceapplication -name "SERVERNAME Search Service" -applicationpool $app
$proxy = new-spenterprisesearchserviceapplicationproxy -name "SERVERNAME Search Service" -Uri $searchapp.uri.absoluteURI
$proxy.status

#####IF THE PROXY IS OFFLINE ENTER THIS##### $proxy.status = “online”
#####IF THE PROXY IS OFFLINE ENTER THIS##### $changestatus.update()

$si = get-spenterprisesearchserviceinstance –local
$si.status
Start-SpEnterpriseSearchServiceInstance -identity $SI
set-spenterprisesearchadministrationcomponent –searchapplication $searchapp –searchserviceinstance $si
$ct = $searchapp new-spenterprisesearchcrawltopology
$csid = $SearchApp.CrawlStores select id
$CrawlStore = $SearchApp.CrawlStores.item($csid.id)
$hname = hostname
new-spenterprisesearchcrawlcomponent -crawltopology $ct -crawldatabase $Crawlstore -searchserviceinstance $hname
$ct set-spenterprisesearchcrawltopology -active
$qt = $searchapp new-spenterprisesearchquerytopology -partitions 1
$p1 = ($qt get-spenterprisesearchindexpartition)
new-spenterprisesearchquerycomponent -indexpartition $p1 -querytopology $qt -searchserviceinstance $si
$PSID = $SearchApp.PropertyStores Select id
$PropDB = $SearchApp.PropertyStores.Item($PSID.id)
$p1 set-spenterprisesearchindexpartition -PropertyDatabase $PropDB
$qt Set-SPEnterpriseSearchQueryTopology -Active

Cannot reuse a deleted Managed Service Application name in SharePoint 2010

If you arrive in a situation where you cannot reuse an old deleted service application name because its supposedly in use or similar, then you can run the following commands.

The first one is as follows - in powershell;

C:\Users\installation> get-SpServiceApplicationPool

This will now show up the names for the Application Pools. Simply identify which one you need to delete, and then run the below command and adjust with the relevant name;

C:\Users\installation> Remove-SpServiceApplicationPool "APPLICATION NAME HERE"

Friday, 13 August 2010

This item and all items under it will not be crawled because the owner has set the NoCrawl flag to prevent it from being searchable

“This item and all items under it will not be crawled because the owner has set the NoCrawl flag to prevent it from being searchable"

In order to fix this issue (and this is true for any Site Collection), is to navigate to your MySite host and click on Site Actions > Site Settings.

From here, click on “Search and offline availability” under Site Administration, and ensure that you have Allow this site to appear in search results? set to Yes.

Sunday, 1 August 2010

PSConfig Checks

Below are some typical things you can check when running the PSConfig command when it fails:

1. Check the text carefully, is the server name and logon correct?
2. Is Windows 2008 being used? You may need to make firewall exceptions such as port 1433-1434 (SQL Database Engine)
3. Check that TCP/IP is enabled in SQL Configuration Manager
4. Do the servers ping each other?
5. Do the service accounts (installation and farmadmin) have the relevant SQL rights? (dbcreator, securityadmin and public?)