15 Ekim 2012 Pazartesi

Sharepoint add new managed account via power shell

Hi,

What you need to do is:
Type:

$cred = Get-Credential

Enter your credits on logon screen.

Create account cmd:
New-SPManagedAccount –Credential $cred

Check account if created:
Get-SPManagedAccount


Source:
http://www.petestilgoe.com/2011/01/sharepoint-2010-adding-a-new-managed-account-from-different-domain-errors-with-access-denied/

9 Ekim 2012 Salı

The backup set holds a backup of a database other than the existing

Hi,
If you encounter this error, it means you are trying to restore a database which is still active.

In order to restore the DB you should run the command with REPLACE command.

If you do it by sql command, add "WITH REPLACE" keyword at the end of the command.

Or if you do by Management Studio, Go to Options on the Left of the Restore screen.

In Restore Options Check "Overwrite the existing database (WITH REPLACE)" checkbox.


Cheers

A nonrecoverable I/O error occurred on file

Hi,
You get this error if you d like to backup a database.

Please make sure you have enough disk space : )

Cannot uninstall Language Pack 0 because it is not deployed

If you have this error, it means you are trying to uninstall a solution which is not installed (deployed).

So,
First check Central Administration - System Settings - Manage Farm Solutions - Check if your solution is deployed. If it is not, deploy it.

If you have trouble by deploying it, try to remove the solution. (Yeah, skip uninstall phase)

Removing solution PowerShell cmd:
Remove-SPSolution -Identity solution.wsp -Force
Removing solution stsadm cmd:
stsadm -o deletesolution -name solution.wsp -override

Add Solution PowerShell cmd:
Add-SPSolution D:\solution.wsp
Add Solution stsadm cmd:
stsadm.exe -o addsolution -filename D:\solution.wsp

Install Solution PowerShell cmd:
Install-SPSolution –Identity solution.wsp -GACDeployment -Force
Install Solution stsadm cmd:
stsadm -o deploysolution -name solution.wsp -immediate -allowCasPolicies -force -allowGacDeployment

3 Ekim 2012 Çarşamba

Sharepoint 2010 - SharePoint Error: The exported site is based on the template STS#1 but the destination site is based on the template STS#0

Hi,
If you would like to restore a site which is created as TeamSite but you would like to restore it on a Blank Site you ll see this error.

In order to fix it you should recreate the site with right template.

Here is the list:
Source:
http://blogs.technet.com/b/araviraj/archive/2008/06/18/sharepoint-templates-types.aspx

GLOBAL#0
 Global template (1033)
STS#0
 Team Site (1033)
STS#1
 Blank Site (1033)
STS#2
 Document Workspace (1033)
MPS#0
 Basic Meeting Workspace (1033)
MPS#1
 Blank Meeting Workspace (1033)
MPS#2
 Decision Meeting Workspace (1033)
MPS#3
 Social Meeting Workspace (1033)
MPS#4
 Multipage Meeting Workspace (1033)
CENTRALADMIN#0
 Central Admin Site (1033)
WIKI#0
 Wiki Site (1033)
BLOG#0
 Blog (1033)
BDR#0
 Document Center (1033)
OFFILE#0
 Records Center (1033)
OFFILE#1
 Records Center (1033)
OSRV#0
 Shared Services Administration Site (1033)
SPS#0
 SharePoint Portal Server Site (1033)
SPSPERS#0
 SharePoint Portal Server Personal Space (1033)
SPSMSITE#0
 Personalization Site (1033)
SPSTOC#0
 Contents area Template (1033)
SPSTOPIC#0
 Topic area template (1033)
SPSNEWS#0
 News Site (1033)
CMSPUBLISHING#0
 Publishing Site (1033)
BLANKINTERNET#0
 Publishing Site (1033)
BLANKINTERNET#1
 Press Releases Site (1033)
BLANKINTERNET#2
 Publishing Site with Workflow (1033)
SPSNHOME#0
 News Site (1033)
SPSSITES#0
 Site Directory (1033)
SPSCOMMU#0
 Community area template (1033)
SPSREPORTCENTER#0
 Report Center (1033)
SPSPORTAL#0
 Collaboration Portal (1033)
SRCHCEN#0
 Search Center with Tabs (1033)
PROFILES#0
 Profiles (1033)
BLANKINTERNETCONTAINER#0
 Publishing Portal (1033)
SPSMSITEHOST#0
 My Site Host (1033)
SRCHCENTERLITE#0
 Search Center (1033)
SRCHCENTERLITE#1
 Search Center (1033)
SPSBWEB#0
 SharePoint Portal Server BucketWeb Template (1033)

2 Ekim 2012 Salı

Sharepoint 2010 - No content databases in the web application were available to store your site collection

Hi,
One of the weird behaviours of Sharepoint is that if you remove a site collection and restore it it would give the error "The operation that you are attempting to perform cannot be completed successfully. No content databases in the web application were available to store your site collection. The existing content databases may have reached the maximum number of site collections, or be set to read-only, or be offline, or may already contain a copy of this site collection. Create another content database for the Web application and then try the operation again."

The reason is that the deleted solution is not deleted, it is still in some sort of a Recycle Bin of SP, so if you d like to restore the SC, SP prompt you this error.

For example,
If you delete the SC from the Central Admin, you ll see the deleted site is still in somewhere.

You can see the deleted site with the command (PowerShell)

get-spdeletedsite

In order to delete this site properly, you can use one of the following commands:

Remove-SPSite –Identity http://sharepoint.com
get-spdeletedsite -webapplication http://sharepoint | Remove-SPDeletedSite
remove-spdeletedsite a56372bd-c6cc-4389-a8cb-089e0cddf7e3 -confirm:$false

But, keep in mind that the Gradual Delete Job would not delete the site right away, even you query the deleted site list with  "get-spdeletedsite" command, you ll see nothing, it doesn t mean that they are removed.

I think the Gradual Delete Job works once in a day or sth like that, so you should start the job manually.

Since I have done this job at the end of the day, in the morning everything was just fine.

I ll share if I can find how to trigger the job manually, I think it is in Central Admin - Monitoring..

Cheers


Source:

http://sharepoint.stackexchange.com/questions/31048/restore-spsite-reports-no-content-databases-are-available-for-this-operation
http://reality-tech.com/2012/04/04/gradual-site-collection-deletion/

Sharepoint 2010 Restore a site collection backup

Hı,

If you d like to restore a site collection you should open the PowerShell as admin and type the following command:


Restore-SPSite -Identity "http://yoururl" -Path "C:\SiteCollectionBackups\backup.bak" -Force


Source:
http://sharepointciyiz.biz/post/2011/07/08/SharePoint-2010-Site-Collection-Backup-and-Restore.aspx

1 Ekim 2012 Pazartesi

Sharepoint 2010 Export all the solutions (wsp files)

Hi,

If you d like to get all the solutions (wsp files) from a sharepoint server and save them into a location, you just need the below code:

Open the Power Shell as Admin, type:


Add-PSSnapin Microsoft.SharePoint.PowerShell –erroraction SilentlyContinue 
## setup our output directory 
$dirName = "d:\exports\ExportedSolutions
Write-Host Exporting solutions to $dirName 
 foreach ($solution in Get-SPSolution) 
 { 
 $id = $Solution.SolutionID 
 $title = $Solution.Name 
 $filename = $Solution.SolutionFile.Name 
 Write-Host "Exporting ‘$title’ to …\$filename" -nonewline 
 try 
 $solution.SolutionFile.SaveAs("$dirName\$filename")
 Write-Host " – done" -foreground green 
 } 
 catch 
 {
 Write-Host " – error : $_" -foreground red 
 }
 }

You can change the output location as you want, it would save all the solutions.

Great time saver !

Cheers

PS: Sorry I forgot to give the source, but you can google it though.