środa, 28 listopada 2012

The ultimate way to delete SharePoint application service

i.e. Search Service Application:
stsadm.exe -o deleteconfigurationobject -id "[GUID]"

And that way you can get to know the id:
Get-SPServiceApplication |?{$_.name -eq "[ServiceApplicationName]"}


środa, 21 listopada 2012

How to rename Search Service Application databases

There are 3 databases related to Search Service Application:
  1. Administration
  2. Crawl
  3. Property
Go to Central Administration > Application Management > Manage service applications. Find on the list application of type “Search Service Application” and click on its name. Then click on the Modify button.
Now you can see these databases.
From Central Administration you can rename only the Crawl and Property databases.
For each database select Edit Properties and change the database name. “Pending update” message appears in the Pending Changes column. Then click on Apply topology changes button. Wait patiently, on my machine it took above 10 minutes to complete.
You cannot rename Administration database from Central Administration. Run Sharepoint Managemet Shell for this purpose.
Before renaming the database, you have to pause the Search Service. But first step is to get to know Search Service identity. You can read the id of your Search Service Application when you run this command:
Get-SPEnterpriseSearchServiceApplication

Pause the service:
Get-SPEnterpriseSearchServiceApplication -Identity " service_id " | Suspend-SPEnterpriseSearchServiceApplication

Rename the database:
Set-SPEnterpriseSearchServiceApplication -Identity " service_id " -DatabaseName "new_database_name" -DatabaseServer "sql_server_name"

Resume the service:
Get-SPEnterpriseSearchServiceApplication –Identity "service_id" | Resume-SPEnterpriseSearchServiceApplication

In case there were any problems with renaming the database, after suspending the service run the Sql Server Management Studio. From here you can rename the database or, what is much safer , make a copy of it. After you have rename the database "manually", run the Set-SPEnterpriseSearchServiceApplication command.