Posts Tagged ‘SharePoint Server 2010’

Deleting the SharePoint2010 Search service application

To delete the Search service application, perform the following.

  1. Go to Central Administration
  2. Click on ‘Manage Services applications’ under Application Management.
  3. Select the ‘Enterprise Search Service Application’ from the list of service applications. The name may differ as per your configuration.
  4. Click on ‘X’ Delete button from the Ribbon.
  5. Check the ‘Delete the content database as well’ option from the diaglog.
  6. Click OK.

While deleting the search service application, the page hangs and keeps showing the same messaging like “Deleting the service application…..”. Even if you leave it untouched for hour or two or three like that… nothing happens, it would just hang on from the Central administration.

In such case, perform the below operations to get them cleaned fully from the Farm.

  1. Get the Search Service application Id – You would get it when you click on the Search Service application from the Manage Service Applications page.
  2. Execute the following STSADM command
    Stsadm -o deleteconfigurationobject -id f1d41cf0-50d0-4fcc-9087-344103757277
  3. Connect to the DataBase Server
  4. Delete the Search Service Application Specific databases (CrawlStoreDB, Application_DB and PropertyStore_DB ) manually.
Now that the Service application has been cleaned successfully. You could go ahead and configure the Search service application now.
Note:  STSADM command is still powerful in this case over PowerShell Command. Here is the PowerShell command as an alternative:
$spapp = Get-SPServiceApplication -Name "Enterprise Search Service Application"
Remove-SPServiceApplication $spapp -RemoveData
This is still taking 15 and more… and executing..
Gangadhar Kotu
Advertisements

SharePoint: Service Unavailable with 503 error

I was working on a POC and all of the sudden my SharePoint site and Central Admin started giving me the error ‘Service Unavailable HTTP Error 503. The service is unavailable’ and I was not able to access either of them.

I realized that I had changed the password to the Identity account password (20 days ago) and just recycled the app pool now. Then this started happening. So I did the below to get the sites up and running after giving lots of scratch to my head.

  1. Open up IIS Manager and click on Application Pools.
  2. Locate your Application Pool for which the Account password reset happened and right-click on it and select ‘Advanced Settings’.
  3. Click on the right of the Identity box to change it (A window will pop up).
  4. Click on Set and simply retype your App Pool Identity in there with the new password.

How weird it is but unfortunately this is how it works.

Microsoft should take care of thread Identities in the future releases…. 🙂

Gangadhar Kotu

SharePoint 2010 PowerShell CmdLets

Hey, I’m back with couple of PowerShell CmdLets for SharePoint 2010.

Save any of the following as .ps1 file and execute them in the PowerShell command prompt.

  1. Get the list of web templates
  2. get-spwebtemplate | sort-object "name"

  3. Create a site collection
  4. Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue
    $server = Read-Host “Enter SQL Server”
    $dbname = Read-Host “Enter Database Name”
    $webapp = Read-Host “Enter Web Application URL”
    $site = Read-Host “Enter New Site Collection URL”
    $sitecollectionname = Read-Host "Enter Title of the Site collection"
    $sitedesc = Read-Host "Enter Description of the Site collection"
    $owner1 = Read-Host “Enter Primary Site Collection Admin”
    # $owner2 = Read-Host “Enter Secondary Site Collection Admin”
    # $sitetemplate = Read-Host "Enter Template name for the Site Collection"
    New-SPContentDatabase -Name $dbname -DatabaseServer $server -WebApplication $webapp | out-null
    New-SPSite -URL $site -OwnerAlias $owner1  -ContentDatabase $dbname -Name $sitecollectionname -Description $sitedesc -Template STS#0 | out-null
    Get-SPContentDatabase -Site $site | Set-SPContentDatabase -MaxSiteCount 15000 -WarningSiteCount 9000
    Write-Host ” “
    Write-Host “Site Collection at” $site “has been created in the” $dbname “content database” -ForegroundColor Yellow
    #-SecondaryOwnerAlias $owner2 - Add this to SPSite to add Secondary SCA

  5. Restore a site collection
  6. Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue
    $server = Read-Host “Enter SQL Server”
    $dbname = Read-Host “Enter Database Name”
    $site = Read-Host “Enter New Site Collection URL”
    $path = Read-Host "Enter backup path location"
    Restore-SPSite -Identity $site -Path $path -DatabaseServer $server -DatabaseName $dbname -Force -Verbose
    Write-Host ""
    Write-Host "Site collection " $site " has been restored properly in the” $dbname “content database” -ForegroundColor Yellow

  7. Moving a Site collection from one content database to another content database
  8. $siteUrl = Read-Host “Enter Site Collection URL to be moved”
    $newDBName = Read-Host “Enter destination Database Name”
    $contentDBInfo = Get-SPContentDatabase -Site $siteUrl
    $oldDBName = $contentDBInfo.Name
    Move-SPSite -Identity $siteUrl -DestinationDatabase $newDBName
    Write-Host ""
    Write-Host "Site collection " $siteUrl "has been moved from " $oldDBName "to " $newDBName " successfully." -ForegroundColor Blue

  9. Create a content database for a web app
  10. Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue
    $server = Read-Host “Enter SQL Server”
    $dbname = Read-Host “Enter Database Name”
    $webapp = Read-Host “Enter Web Application URL”
    New-SPContentDatabase -Name $dbname -DatabaseServer $server -WebApplication $webapp | out-null

  11. Removing content database from FARM and DB
  12. Remove-SPContentDatabase -Identity <Content DB Guid>
    Alternatively you can use the below one:
    $dbname = Read-Host “Enter Database Name”
    get-SPContentDatabase -Identity $dbname | Remove-SPContentDatabase
    Write-Host ""
    Write-Host "The content dabase" $dbname "has been deleted successfully." -ForegroundColor Blue

  13. Exporting a Site – While exporting the site contents, it would also retain the metadata like created date, modified date, author name, …..
  14. $siteUrl = Read-Host "Enter the Source Site Url"
    $path = Read-Host "Enter the destination file path"
    Export-SPWeb -Identity $siteUrl -Path $path -IncludeVersions All -IncludeUserSecurity -Verbose
    Write-Host ""
    Write-Host "The site" $siteUrl "content has been exported from" $path "successfully" -ForegroundColor Blue

  15. Importing a Site – While importing the site contents, it would also retain the metadata like created date, modified date, author name, …..
  16. $siteUrl = Read-Host "Enter the Destination Site Url"
    $path = Read-Host "Enter the backup file path"
    Import-SPWeb -Identity $siteUrl -Path $path -UpdateVersions Overwrite -IncludeUserSecurity -Verbose
    Write-Host ""
    Write-Host "The site" $siteUrl "content has been imported from" $path "successfully" -ForegroundColor Blue

    Regards

    Gangadhar Kotu

SharePoint Server 2010 Material

Hi,

Here are couple of SharePoint Server 2010 Material available across.

  1. Having good videos for development – http://msdn.microsoft.com/hi-in/sharepoint/ee513147(en-us).aspx
  2. Migration content http://blogs.technet.com/tothesharepoint/default.aspx
  3. Programming http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010programming/threads
  4. http://social.msdn.microsoft.com/Search/en-US?query=sharepoint%202010&ac=8
  5. Deprecated classes/methods: http://code.msdn.microsoft.com/sps2010deprecated

~ Gangadhar Kotu