Pages

Saturday, April 28, 2012

Abandoned or Unused Service Application Pools in SharePoint 2010

Few days back I was given a task to add service account to SharePoint. I started Central Administration and navigated to Security –> Configure Managed Accounts.I clicked on Register New Managed Account to add new account. There i found a normal account that need to be deleted because all services are configured to run with service account. But when i tried to delete that account , error message was displayed with one Application Pool mentioned. The account was associated with this application pool but this application pool was not present in IIS. It seems the application pool was created some time but never used. I tried to find out the application pool but failed.

I searched on Google and checked many sites then i came across one site where i found my solution. (Sorry but i don’t remember the site URL) . So solution for this problem was very simple which is as mentioned below :-

1.) Start SharePoint Management PowerShell.

2.) Type below command. It will return you list of all SharePoint Application pools with Name, Associated user Id etc.

       GET-SPServiceApplicationPool

3.) Identify the application pool that was mentioned in error message and verify the associated ID.

4.) This command can be used to get GUID of service application pool to use with Remove command or Remove command can be used directly.

      GET-SPServiceApplicationPool –Identity <Service Application Pool Name>

5.) Use below command to remove service application pool.

     Remove-SPServiceApplicationPool –identity <GUID received in previous step>

                                       OR

    Remove-SPServiceApplicationPool <Service Application Pool Name>

6.) Confirmation to delete will be prompted and application pool will be deleted.

 

NOTE :- This command will permanently delete the service application pool so please make sure you are deleting correct service application pool.

Saturday, July 9, 2011

Rename PerformancePoint Service database in SharePoint 2010

PerformancePoint Service database created by default contains GUID as suffix in name. But what if we dont want GUID in name and want to provide name with proper naming convention. I faced this issue in my project , then I came to know how it can be done. I will take you through a number of steps following which we can rename database .

1.) Start SharePoint 2010 Central Administration -> System Settings -> Manage Services on Server.
2.) Locate PerformancePoint Service and click Stop.
3.) Start SQL Server Management Studio , backup PerformancePoint Service database .
4.) In left pane of Management Studio , right click Databases and select 'Restore Database'.
5.) Provide new database name for 'To Database' textbox, select 'From Device' option  and browse to the backup of old PerformancePoint database. Select Ok.
6.) Now Go to Start -> All Programs -> Microsoft SharePoint 2010 Products -> SharePoint 2010 Management PowerShell.
7.) Type below command to get all information about PerformancePoint Service Application:
        
     Get-SPPerformancePointServiceApplication "PerformancePoint Service Application"

8.) Declare a new variable and assign new database name to that variable :
   
     $newdatabasename = "<New Database Name>"          (Name without angle brackets)

9.) Assign new database to PerformancePoint Service :
 
     Set-SPPerformancePointServiceApplication -Identity "PerformancePoint Service Application"   -SettingsDatabase $newdatabasename

10.)We are done with SharePoint 2010 Management Powershell.
11.) Navigate to 'Manage Services on Server ' and start the PerformancePoint service , if not started.
12.) Last step is to delete Old PerformancePoint Service database from SQL Server.

Sunday, June 5, 2011

Rename Central Admin Database in SharePoint 2010 using Sharepoint PowerShell

In SharePoint , databases created by default have GUIDs as suffix. But sometimes , requirement is such that we do not want GUIDs in database names. In one of my project also , there was a requirement to rename Central Administration database. There is a step-by-step solution for this :-

1.) Start SharePoint 2010 Management PowerShell.

2.) Type below command to get information about content database being used  by Central Admin
   
     Get -spcontentdatabase  -webapplication <Central Admin Url>

     This command show content database id, name, web application, database server  and count.

     Mark the id of this content database.
 
3.) Now we have to create a new content database to attach with Central Admin, for that type the below command

     New -spcontentdatabase  -name <Database Name>  -webapplication <Central Admin Url>

4.) Again run powershell command mentioned in Step 2, this time it will show two content database information, old and new content database.

     Mark the id of new COntent database.

5.) To move the site collection from old content database to new content database , type below command in powershell

     Move -SPSite -ContentDatabase <old Content DB id> | Move -SPSite -DestinationDatabase  <new Content DB id>

6.) If you run the command in Step2 , you will see the new content database is attached to Central Admin. Now you can delete the content database from SQL Server Manegement Studio.

7.) Start SQL Server Management Studio, select the database, right click and select delete. But before pressing OK, select checkbox "Close Existing Connections" and we are done.

     Now we have Central Admin content database name as per our requirement.But if you again run command mentioned in Step2 , you will still find two content database.

     To get rid of this, we have to perform few more steps :-

8.) Start Central Admin -> Application Management -> Manage Content Database.

9.) On Manage Content Database page , select Central Admin Webapplication. It will show you two content databases, one with GUID (old) and one without GUID (new).

10.) Click on old Content Database to detach, it will open Manage Content Database Settings page. Select Remove Content Database and click OK

11.) Again if you run powershell command in Step2 , now you will get only one Content database  i.e. new Content database with custom name.
     
      Hope this is helpful for SharePoint 2010 users.