viernes, 21 de diciembre de 2012

Get Sharepoint 2010 Site Collection Storage Usage

If you need to get the Storage Usage from a Sharepoint 2010 Site Collection, you can do this with Powershell.

1. Start SharePoint 2010 Management Shell or Powershell with the Sharepoint Snapin by:
Add-PSSnapin "Microsoft.SharePoint.PowerShell"

2. Create a new Object for a Site Collection:
$MySite = Get-SPSite http://my.sharepoint.com

3. You can now check the members of the $MySite Object:
$MySite | Get-Member (You could also use: Get-SPSite http://mysite.sharepoint.com | Get-Member)

4. Now you get an output with a lot of member properties of this Site Collection Object. And you can see there is a member property called Usage, I think thats the right property. Now lets see what we get here:

$MySite.Usage
retruns:
Storage           : 1775819
Bandwidth         : 0
Visits            : 0
Hits              : 0
DiscussionStorage : 0


Ah there is a Storage property, lets use this to only get the used Storage:
$MySite.Usage.Storage

this returns the Storage Space in Bytes. Not really use full, so we get this in Megabytes:
$MySite.Usage.Storage / 1MB

returns:
1.6935....

Count Sharepoint Sites on Sharepoint Server 2010

 
(Get-SPSite -Limit all).Count

Backup, Restore Site Collection from PowerShell

Backup-SPSite -Identity "http://SP2010/sites/SC" -Path "C:\Temp\backup1.bak" -Force
Restore-SPSite -Identity "http://SP2010/sites/SC" -Path "C:\Temp\backup1.bak" -Force

A simple install of SQL Server 2012 for SharePoint Server 2013 or 2010

http://msmvps.com/blogs/shane/archive/2012/09.aspx

Solutions from your farm

Extract all of the Solutions from your farm


(Get-SPFarm).Solutions | ForEach-Object{$var = (Get-Location).Path + "\" + $_.Name; $_.SolutionFile.SaveAs($var)}

Quickly let's see if we can break this down and explain the pieces.

Get-SPFarm does just that it gets your current farm. When I put it in the ( ) that returns the farm. Then I tack on .Solutions which returns all of the solutions in the farm. From there I pipe the solutions over to old faithful ForEach-Object. ForEach-Object says do everything within the { } to each solution passed from the pipe. Within the { } I use $var = to set the variable's value to Get-Location which returns the current location you are at in the file system. .Path returns that location. (Example output: c:\backupfolder) The + says continue to add to the $var variable. "\" adds a \ to the $var variable. Another + means keep adding to the variable. $_.Name says give me the name property of the current solution. So this ends up setting the value of $var to c:\backupfolder\mysolution.wsp assuming the solution filename was mysolution.wsp and we were running our PowerShell from the folder c:\backupfolder. Finally we have a ; which means we are all done with that line.

We follow up setting the variable with $_.SolutionFile.SaveAs($var). $_.SolutionFile is a property of the current solution. .SaveAs is a method for saving that file. That method needs to know what filename to save the solution to. We give it $var which is the variable we just created.

Boom! Just like that you have exported all of the solutions from your farm to a handy, dandy folder.

Import all of the Solution into another farm


Now because I am naturally lazy I said "I bet we can figure out how to script importing all of those to our farm." After a little playing turns out you can with the following PowerShell.

Get-ChildItem | ForEach-Object{Add-SPSolution -LiteralPath $_.Fullname}

So how does that work? Get-ChildItem returns all of the files in a folder so if you navigate to the folder you copied over all of the solutions to you return them all. For this example we will say we are in the folder c:\copiedfolder. We then pipe those files over to ForEach-Object so we can do everything within the { } to each object. Add-SPSolution is a SharePoint cmdlet for adding solutions to a farm. –LiteralPath is a required parameter where you need to provide the path to the solution to import. $_.Fullname returns the .fullname property of the object. So in this case it returns c:\copiedfolder\mysolution.wsp.

Oh yeah! Just like that all 25 of those solutions are added to our farm.

Deploy all of those Solutions


So we got this far without me having to type in a bunch of crap so surely we can automate this part also. <he he he> (Keep in mind when I explain the developer crap below it might not be 100% perfect but you get the idea.)

Get-SPSolution | ForEach-Object {If ($_.ContainsWebApplicationResource -eq $False) {Install-SPSolution -Identity $_ -GACDeployment} else {Install-SPSolution -Identity $_ -AllWebApplications -GACDeployment}}

Get-SPSolution is pretty easy that returns all of the solutions in the farm. As a side note there are a lot of properties you can play with here. So you could for example find out which ones are already deployed, in our case we didn't have any solutions so we didn't mess with it. ForEach-Object is going to run all of the cmdlets within the { } on each solution. The If cmdlet allows us to evaluate the contents of ( ) if it is true we do the next set of { } if it is false then it will process the { } after the else statement. $_.ContainsWebApplicationResoruces is a true or false property of a solution. –eq checks if the property is equal to $False. $False is a PowerShell system variable that represents false. So this statement checks to see if the solution has web application resources because if it does we need to install the solution a different way. For the solutions that don't have web resources ($false) we run {Install-SPSolution -Identity $_ -GACDeployment} which is the SharePoint PowerShell cmdlet for deploying a global solution. For the solutions that do have web application resources we run {Install-SPSolution -Identity $_ -AllWebApplications -GACDeployment} which just tells SharePoint to deploy those resources to all of the web applications in our farm. I am guessing you don't necessarily have to deploy them all to the GAC (-GACDeployment) but this is the way my customer wanted it so I said ok.

When you run the command you should just be returned to the prompt. You can then go to Central Admin > System Settings > Manage farm solutions. Here you will see your solutions and their current status. If you deploy a lot at once it can take 10 minutes or more for them all to go from deploying to deployed but they will. Just be patient.

Hopefully now you feel equipped to go play. Remember the idea here is for you to learn about the moving pieces. Yes my scripts work as is but I am guessing you can take these and massage them to be much cooler. I am just a PowerShell hack who figures out the first solution that works instead of always figuring out how I can refine it to the most efficient, coolest thing ever. J Though I do think I had it worked out to do the import and deploy in one string of commands but we had to return to real work before we finished that part.

jueves, 13 de diciembre de 2012

Windows 2008 R2 IIS Backup and Recovery

En Windows 2008 R2 IIS podemos hacer backup, restore de la configuración de IIS utilizando appcmd.
  • Para hacer backup de IIS:
C:\>windows\system32\inetsrv\appcmd.exe add backup “IISbackup”
  • Restore:
C:\>windows\system32\inetsrv\appcmd.exe restore backup “IISbackup”
  • Borrar un backup:
C:\>windows\system32\inetsrv\appcmd.exe delete backup “IISbackup”
  • Ver la lista de backups:
 C:\>windows\system32\inetsrv\appcmd.exe list backup

The server could not complete your request SharePoint designer 2010

 Intentamos abrir un sitio con SharePoint Designer 2010 y nos da el siguiente mensaje:
"the server could not complete your request SharePoint designer 2010”
 
hacemos clic en detalles pero no hay información.
 

Solución:

1. Open IIS Manager (Click Run in start menu and then type INETMGR)
2. Find the desired site in IIS Manager
3. Open “Authentication” from body panel
4. Select Windows Authentication
5. Click “Advance Settings…” in the right panel
6. Select “Off” from the extended protection dropdown box
7. Select the check box for Enable Kernel-Mode authentication
8. Click Ok.
9. IISRESET

martes, 11 de diciembre de 2012

Control de Versiones en SharePoint 2010

Dentro de la funcionalidad nativa de SharePoint está la Administración de documentos a través del uso de Bibliotecas.
Estas bibliotecas están preparadas para realizar una gran cantidad de tareas de control y que sólo requieren activarse para poder usarse; una de estas funcionalidades es el control de versiones.
El control de versiones está deshabilitado de forma predeterminada por una muy buena razón: si se habilita el control de versiones y no es correctamente configurado y usado, las bases de datos que almacenan la información de SharePoint crecerán de forma incontrolable poniendo en riesgo todos los datos del sistema.
Antes de habilitar esta funcionalidad es necesario examinar qué tipo de control de versiones se requiere, cómo se usará y cuál es el número de versiones que se conservarán. Decidido esto, es muy sencillo habilitar este control.
En una biblioteca de SharePoint, seleccionamos la pestaña Biblioteca y luego hacemos clic en el botón Configuración de la Biblioteca.

Dentro de las opciones de configuración seleccionamos Configuración de versiones.
Aquí entre otras cosas, podemos decidir el tipo de control de versiones que deseamos habilitar: Versiones mayores o Versiones mayores y menores.

A menos que exista una muy buena razón para querer utilizar versiones menores, las versiones mayores podrán atender correctamente el requerimiento de almacenar distintas versiones de los documentos.
Una vez habilitado el tipo de control de versiones, debemos decidir también cuál es el número de versiones que conservaremos tomando en cuenta que esto puede afectar directamente al tamaño de las bases de datos que se usan para alojar la información de los sitios de SharePoint.
Hechos los cambios, hacemos clic en Aceptar y con esto quedará activado el control de versiones.
En adelante cuando se modifique un documento, se almacenará una nueva versión y podremos visualizar las versiones en la sección Historial de versiones pudiendo acceder a una versión anterior del documento, restaurarla como versión actualizada o realizar una comparación de las versiones cuando se abre con el software del documento.
Si hacemos clic directamente en el nombre del documento se abrirá la última versión. Para abrir una versión anterior mostramos el menú emergente del documento y seleccionamos la opción Historial de versiones.

Con esto se mostrará el cuadro de control de las versiones. Para abrir una versión en específico basta con hacer clic en la fecha correspondiente a la versión.


1 comentario de:

  1. Un comentario: los usuarios anónimos no pueden ver las versiones menores (borradores).
 

#SharePoint - Administrar listas y bibliotecas con muchos elementos

http://office.microsoft.com/es-ar/sharepoint-server-help/administrar-listas-y-bibliotecas-con-muchos-elementos-HA010378155.aspx#BM3aAdministrar listas y bibliotecas con muchos elementos

Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))

Cuando intentamos subir archivos a una Document Library de SharePoint 2010 nos da el siguiente mensaje:

Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))
 
If some of you have come across this error and don't know how to fix it, I have found 2 possible fixes.

  1. Recreate the site collection
  2. Webtempcustom.xml file in the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML directory was corrupt and it was causing the problem.

You can try to fix the xml file, but much easier just to re-create the site collection.

sábado, 8 de diciembre de 2012

SharePoint Server 2010 Patch Levels


SharePoint Server 2010 Patch Levels

Ejecutar desde PowerShell: (get-spfarm).buildversion


O desde Central Administration| System Settings | Manage servers in your farm

Windows PowerShell for SharePoint Command Builder

http://www.microsoft.com/resources/TechNet/en-us/Office/media/WindowsPowerShell/WindowsPowerShellCommandBuilder.html

Obtener el tamaño de las bases de datos de Sharepoint

Desde SQL

SELECT d.name,
ROUND(SUM(mf.size) * 8 / 1024, 0) Size_MBs
FROM sys.master_files mf
INNER JOIN sys.databases d ON d.database_id = mf.database_id
WHERE d.database_id > 4 -- Skip de las bases de sistema
GROUP BY d.name
ORDER BY d.name


Desde PowerShell

Get-SPDatabase | Sort-Object disksizerequired -desc | Format-Table Name, @{Label ="Size in MB"; Expression = {$_.disksizerequired/1024/1024}}

viernes, 7 de diciembre de 2012

PerformancePoint Services para SharePoint 2010

Overview: PerformancePoint Dashboard Element: 
http://www.youtube.com/watch?v=xIMi6hii-zs

PerformancePoint Services tiene una misión importante en la vida: permitirle crear paneles enriquecidos y controlados por el contexto que agreguen datos y contenido para proporcionar una vista completa del desempeño de un negocio en todos los niveles.
Si echa un vistazo a los estantes de inteligencia empresarial de Microsoft, encontrará varias herramientas para crear paneles para visualizar y entender un negocio; y PerformancePoint Services es una de las mejores herramientas. El diferenciador de PerformancePoint tiene dos vertientes. Tal vez desee usar PerformancePoint como una ruta directa para integrar los datos en SharePoint de una manera interactiva y nativa. La segunda es que PerformancePoint es la herramienta de elección cuando se necesita dar a los usuarios la capacidad de análisis a la vez que se mantiene aún el control y la seguridad que requieren las necesidades de un negocio.
Obviamente, el acceso a los datos es la preocupación más grande y PerformancePoint Services se toma muy en serio esa necesidad con la capacidad de crear conexiones a los datos en una selección abundante de orígenes, pero de manera coherente. Ya sea que la compañía tenga un modelo de datos complejo de Analysis Services o que intente informar sobre una colección de orígenes desde las listas de SharePoint hasta los libros de Excel, PerformancePoint tiene cubiertas las necesidades.
Pero, ¿de qué se trata realmente? ¿En qué consiste PerformancePoint Services y cómo se puede obtener valor de él? PerformancePoint Services forma parte de SharePoint 2010 y se expone en una página de elementos web, tal como un usuario experto de SharePoint podría esperar. Su poder real se deja ver de la siguiente forma:
PerformancePoint Services inicia con su experiencia en creación. La aplicación del Diseñador de paneles es el cuadro de herramientas para crear de abajo hacia arriba: indicadores clave de rendimientos (KPI), cuadros de mandos, gráficos analíticos, cuadrículas, informes, filtros y paneles. Cada componente es único en PerformancePoint Services y proporciona funcionalidad que interactúa con un componente de servidor que controla las partes difíciles como la seguridad y conectividad a datos.
El Diseñador de paneles es una experiencia WYSIWYG, las partes que se creen aparecerán en el explorador exactamente como se crearon. Esto nos lleva a la segunda parte: la experiencia del usuario final. PerformancePoint Services está diseñada para compartir. Las partes que se crean se incluyen en un panel y se presentan en una página de SharePoint que entiende quién la está viendo y qué pueden ver. Esto significa que usted diseña y publica, y ellos consumen... sin participación de TI, ni flujos de trabajo complicados.

Export, Import Site en SharePoint 2010 desde PowerShell con IncludeVersions

El siguiente export site incluye todo el historial de versiones y seguridad de usuarios 

Export-Spweb -Identity http://SP2010/sites/SC/site -Path D:\export\site.bak -IncludeVersions All -IncludeUserSecurity


El siguiente export de una Document Library incluye todo el historial de versiones y seguridad de usuarios


Export-Spweb -Identity http://SP2010/sites/SC/site -Itemurl "Document Library" -Path d:\export\DL.bak -IncludeVersions All -IncludeUserSecurity


Si al intentar hacer Export / Import o Backup / Restore, nos encontramos con algún error, verificar que la cuenta que estamos usando tenga privilegios de SPShellAdmin con el commando Get-SPShellAdmin y además tenga privilegios de Owner en la base de datos en SQL Server

Import-SPWeb -Identity http://SP2010/sites/SC/site -Path "D:\export\site.bak" IncludeVersions All -IncludeUserSecurity


Iniciar SQL Server Managment Studio con un usuario particular

Ejecutar de la siguiente manera:

runas /netonly /user:Dominio\Usuario "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"

Delete Site Collection SharePoint 2010

Cuando nos piden borrar una Site Collection en SharePoint 2010 debemos ejecutar el comando:
Remove-spsite  http://sharepoint/sites/SC/  -confirm:$false -gradualdelete
 
En este momento borramos la Site Collection y ya no puede ser accedida.
El Site borrado se va conservar en el Recicle Bin de SharePoint durante 30 días (Default) consumiendo espacio en la base de datos.
 
Para borrar la SC completamente de la base de datos y que no consuma espacio, debemos ejecutar el siguiente comando donde vemos las propiedades de la SC eliminada anteriormente:
 
get-spdeletedsite
 
Ejemplo:
 
PS C:\Users\SPAdmin> Get-SPDeletedSite
 
WebApplicationId : ebe7eeee-9da9-4e7c-b163-1c2306d3fa5e
DatabaseId : 5a1d29a4-5cb1-4200-adfb-eef271cd1072
SiteSubscriptionId : 00000000-0000-0000-0000-000000000000
SiteId : b15c6e1e-16b7-4c81-ac30-ce41ffdf2de0
Path : /sites/dicon
DeletionTime : 8/16/2012 1:49:54 PM
 
Ahora para remover el site completamente de la Base de datos, tomamos el valor “SiteId” y  ejecutamos lo siguiente:
 
remove-spdeletedsite b15c6e1e-16b7-4c81-ac30-ce41ffdf2de0 -confirm:$false
 
Hecho la Site collection fue totalmente eliminada.
 
Para completar la tarea de liberacion de espacio, podemos esperar a que se ejecute un backup de la base, o ejecutar un Shrink Database desde SQL Server Managment Studio.
 

Change SharePoint 2010 Web Application Port Number

Recently, I had to move an existing SharePoint 2010 web application from the default port to a new port.  This is relatively easy to do but does require two steps.  The first is a change made in Central Administration; the second is done in IIS Manager.  Here are the steps I followed:
Step 1
In SharePoint Central Administration:
·         Click Application Management
·         Click Configure Alternate Access Mapping
·         Click the web application you are trying to alter
·         Change the port number by altering the URL; Save
Step 2
In IIS Manager:
·         Select the SharePoint site that corresponds with the web application above
·         Click Bindings…
·         Select the current port; click Edit; change the port number; Save

Backup de una content database en SharePoint 2010

Si precisamos un backup de una base de datos, y no tenemos acceso a Microsoft SQL Server Managment Studio, podes tomar un backup desde powershell.

Ejecutar el comando como admin desde SharePoint managment Shell
Backup-SPFarm -Directory   <Backup folder>  -BackupMethod {Full | 
Differential} -Item <Content database name> [-Verbose]
Ejemplo:
Backup-SPFarm -Directory D:\Temp -BackupMethod Full -Item WSS_CONTENT_CONPOINT01 
-Verbose

Removing libraries that don’t allow deletion in SharePoint

Despite working with SharePoint for a long time now the fact that there are libraries that can’t be deleted by simply going to the list settings page is one of those things that I haven’t come across too often. If there’s no ‘Delete this library’ link what can be done – well, as is becoming the norm, PowerShell to the rescue!
Scenarios where you may see a library like this would be in a site with the publishing feature enabled. For the case of libraries like the Images library, Documents library or even the Site Collection Documents library it is simply not possible to remove them from the lists settings page or the manage content and structure tool.

The reason for this is that on creation the library has been set as False for the property AllowDeletion:

It is obviously possible to delete the library completely using PowerShell (simply by calling the Delete() method on the list) however both for demonstrations purposes – and also so that you can be absolutely sure that you’re deleting the correct library! – I like the approach of updating the AllowDeletion property to True and then deleting the library through the browser.
This can be done with the simple PowerShell below:
$web = Get-SPWeb http://sp2010/sites/publishing
$list = $web.Lists["Documents"]
$list.AllowDeletion = $True
$list.Update()
And now it’s possible to delete the library through the browser!

Did you spot the bonus feature? By doing the above we also enable the ability to save the library as a template too. I haven’t given this a go (as I wanted to get rid of my library not create more from it!) but I can’t immediately think of a reason why it shouldn’t work.
Note – as I was preparing this post I noticed a similar post from an ex-colleague who’d used the same approach to remove a Drop Off Library created by the content organiser feature in SharePoint 2010. You beat me to the punch Paul!
[By the way, in case you’re thinking that this may never be used, I actually had to use it in anger recently when a migration had gone wrong and migrated/ created an image library on a publishing site that couldn’t be deleted any other way.]

SharePoint 2010 Listar SP Solutions y Web Application

Con el siguiente Script, podemos listar las Solutions deployadas en SharePoint 2010 y ademas muestra sobre que Web Application estan aplicadas.
Guardar el siguiente Script como ListarSPSolutions.ps1
$sols = Get-SPSolution
foreach($sol in $sols)
{
$sol.Name
$sol.DeployedWebApplications
}
Ejecutar en SharePoint Managment Shell
ListarSPSolutions.ps1 > D:\Temp\SalidaSPSolutions.txt

SharePoint 2010 Error Unexpected error in Silverlight Application

Some of you  might have come across the error “Unexpected error in Silverlight Application” while trying to create new sites or lists in SharePoint 2010 especially with newly created web applications. Here is a simple fix.
 
 
  1. Navigate to Central Admin > Application Management > Manage Web Applications.
  2. Select the web application having the issue and click General Settings on the ribbon.
  3. Change Web Page Security Validation from Off to On. Click OK to close the window.

Deshabilitar el servicio Office Web Apps en SharePoint 2010

Configurar el comportamiento predeterminado para abrir documentos por el explorador (Office Web Apps)
 
La forma en que se abren los documentos en SharePoint varía en función de si la característica de OpenInClient está presente o no, y de si está habilitada o deshabilitada:
 
 • Si la característica de OpenInClient no está presente y Office Web Apps no está instalado, los documentos se abrirán en la aplicación cliente (valor predeterminado de SharePoint).
 • Si la característica de OpenInClient no está presente, Office Web Apps está instalado y se activan las aplicaciones de servicios de Office Web Apps, los documentos se abrirán en el explorador (Office Web Apps, de forma predeterminada).
 • Si la característica de OpenInClient está presente y habilitada, y las aplicaciones de servicio de las Office Web Apps están activadas, los documentos se abrirán en la aplicación cliente.
 • Si la característica de OpenInClient está presente y deshabilitada, y las aplicaciones de servicio de las Office Web Apps están activadas, los documentos se abrirán en el explorador.
 
El siguiente ejemplo establece el comportamiento predeterminado para abrir todos los documentos en todos los sitios en su aplicación cliente asociada (si está disponible).
 
$defaultOpenBehaviorFeatureId = $(Get-SPFeature -limit all | where {$_.displayname -eq "OpenInClient"}).Id
Get-SPSite -limit ALL |foreach{ Enable-SPFeature $defaultOpenBehaviorFeatureId -url $_.URL }
 
El siguiente ejemplo establece el comportamiento predeterminado para abrir todos los documentos en todos los sitios en el explorador.
 
$defaultOpenBehaviorFeatureId = $(Get-SPFeature -limit all | where {$_.displayname -eq "OpenInClient"}).Id
Get-SPSite -limit ALL |foreach{ Disable-SPFeature $defaultOpenBehaviorFeatureId -url $_.URL }
 
El siguiente ejemplo establece el comportamiento predeterminado para abrir las bibliotecas de documentos protegidas por IRM en todos los sitios en su aplicación cliente asociada (si está disponible).
 
Get-SPWeb -site http://contoso | % {$_.Lists} | where {$_.IrmEnabled -eq $true} | % {$_.DefaultItemOpen =[Microsoft.Sharepoint.DefaultItemOpen]::PreferClient; $_.Update()}

Como saber si un servidor se reinicio

En el event viewer puede verificar si hay dos eventos: Event Id 6005, Event Id 6006

Codigo de errores en SharePoint 2010

401 Errores relacionados a acceso
401;1 acceso no autorizado debido a que el inicio de sesión ha fallado
401;2 acceso no autorizado debido a que el inicio de sesión ha fallado debido a la configuración del servidor
401;3 acceso no autorizado debido a una entrada Access Control List (ACL)
401;4 acceso no autorizado debido a un filtro IIS que esta bloqueando el acceso
401;5 acceso no autorizado debido a una aplicación ISAPI or CGI
403 Errores relacionados a seguridad
403;1 Prohibido el acceso de ejecución, porque no está permitido
403;2 Prohibido el acceso de lectura, porque no está permitido
403;3 Prohibido el acceso a escritura porque no está permitido
403;4 Prohibido ya que el uso de SSL se requiere
403;5 Prohibida por el uso de 128 bits SSL es necesario
403;6 Prohibida porque la dirección IP fue rechazada
403;7 Prohibida porque un certificado de cliente se requiere
403;8 Prohibida ya que el acceso al sitio se le niega
403;9 Prohibido porque hay demasiados usuarios actualmente conectado al sitio
403;10 Prohibido debido a una configuración no válida
403;11 Prohibido debido a una contraseña no válida
403;12 Prohibido ya que el sitio Web requiere un certificado de cliente válido
403;13 Prohibido debido a que el certificado de cliente fue revocado
403;14 Prohibido debido a que el directorio listado se le niega
403;15 Prohibido el acceso porque el número de licencias de clientes se ha superado
403;16 Prohibido ya que el certificado de acceso de cliente no es válida o no es de confianza
403;17 Prohibida ya que el certificado de acceso de cliente ha caducado o aún no es válido
424 errores que normalmente aparecen cuando un nivel de protección de aplicaciones es demasiado alto. Para solucionarlo en tu servidor IIS, Ir a la aplicación web, seleccione la pestaña de propiedades del directorio virtual y establecer la protección de aplicaciones en Bajo (proceso IIS).
500 Error
Se trata de un error genérico interno en el servidor IIS. Una causa común de este error en un entorno de SharePoint es desmarca la opción "verify file exists" en el IIS
503 Error
Esto significa que un servicio ha dejado de funcionar o se puede colgar, ver en el Visor de sucesos en el servidor para ver cuál es la causa del problema

Exportar Solutions en SharePoint 2010 PowerShell

Si necesitamos exportar las solutions que tenemos instaladas en un ambiente de SharePoint para instalarlas en otro ambiente, nos conectamos con una cuenta con privilegios de Farm Administrator y ejecutamos el siguiente comando:

(Get-SPFarm).Solutions |% { $filename = “D:\TEMP\Solutions” + "\" + $_.Name; $_.SolutionFile.SaveAs($filename) }

Backup and Restore with PowerShell Command

Backup a Site collection with PowerShell command
In SharePoint 2010, PowerShell command Backup-SPSite is used for taking backup. The following command will backup the site collection ‘http://myserver’.
 
Backup-SPSite -Identity http://myserver -Path "c:\backup\file.bak"
Restore a Site Collection with PowerShell command
To restore site collection you’ll use the following command. Use –Force if you want to overwrite the existing site collection
 
Restore-SPSite -Identity http://myserver -Path "c:\backup\file.bak"
 
However, once I had restored the backup I could not access the site. The problem was that I needed to deploy the custom SharePoint solution. So in case of site collection migration (with backup/restore) from one server to another or from one site collection to another, the steps should be:
  1. Restore the backup.
  2. If your source site collection (from where you taken backup) uses custom SharePoint solution, then deploy the solution in the destination site collection (where you are restoring the backup). If you try to access the site without deploying solution then you may get the site non-functional.
  3. Now you can try to access the site.
The important point here is that if you take backup from one server to another and restore it, the custom solution related to backup doesn’t go with backup. So after restoring backup you need to manually deploy the solution on the destination server. Then it’ll hopefully work.

Exportar una lista o library particular

Supongamos que necesitamos exportar una lista o library específica. Parece una tarea fácil pero se puede tornar engorrosa por la excentricidad de PowerShell a la hora de tomar las URLs.
Tomemos como ejemplo la siguiente lista: 

http://SP2010/sites/SP/Admin/web/Lists/Tasks/AllItems.aspx

El comando a ejecutar será el siguiente:
Export-Spweb -Identity http://SP2010/sites/SP/Admin/web -Itemurl "Lists/Tasks" -Path d:\temp\web_tasks.cmp

  • Identity: URL del site o subsite donde está situado el elemento a exportar.
  • ItemUrl: El path relativo a la Identity donde se encuentra el elemento. Tener en cuenta de evitar la "/" inicial y final de este dato (de lo contrario powershell no tomará el valor).
  • Path: Path del FS a donde se quiere exportar.

martes, 4 de diciembre de 2012

BLOB caché en SharePoint




BLOB caché de SharePoint: Almacenamiento en memoria caché basada en disco de objetos binarios grandes.

En términos generales, el almacenamiento en caché se utiliza para mejorar el rendimiento mediante la adopción de datos de acceso frecuente y colocándolo en un estado o ubicación que facilita un acceso más rápido.
Almacenamiento en caché suele mejorar el rendimiento y la escalabilidad, y en última instancia, estos tienden a traducirse en una mejor experiencia de usuario.
El almacenamiento en caché de objetos se almacena en cada WFE.
BLOB Basic almacena en caché copias de imágenes, CSS y datos similares de recursos de bases de datos contenidos en el sistema de archivos de un WFE.
La página http://www.ferrari.com es un ejemplo de cómo funciona BLOB caché en SharePoint.
Para visualizar o habilitar BLOB caché, debemos editar el archivo web.config de la Web Application deseada.


Así vamos a encontrar BLOB caché deshabilitado en el web.config:

<BlobCache location="C:\BlobCache\14" path="\.(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv)$" maxSize="10" enabled="false" />

Habilitando BLOB caché (Se recomienda el almacenamiento de cache en una partición que no sea la de sistema)

<BlobCache location="D:\BlobCache\14" path="\.(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv)$" maxSize="10" enabled="true" max-age=”43200” />

En el ejemplo anterior:

-location es el directorio donde se guardarán los archivos almacenados en la memoria caché.
-path específica, en la forma de una expresión regular, los archivos que se almacenarán en la memoria caché en función de la extensión del archivo.
-maxSize es el tamaño máximo permitido del almacenamiento en memoria caché basada en disco en gigabytes.
-max-age especifica la cantidad de tiempo máxima (en segundos) que el explorador cliente almacena en la memoria caché los BLOB descargados en el equipo cliente. Si los elementos descargados no han caducado o expirado desde la última descarga, no se vuelven a solicitar los mismos elementos cuando se solicita la página. El atributo max-age se establece de manera predeterminada en 86.400 segundos (es decir, 24 horas), pero se puede establecer en un período de tiempo de 0 o superior.
-enabled es un valor booleano que deshabilita o habilita la memoria caché.

Referencia:

http://technet.microsoft.com/en-us/library/cc261797.aspx