Mostrando entradas con la etiqueta Sharepoint Server Publishing Infraestructure. Mostrar todas las entradas
Mostrando entradas con la etiqueta Sharepoint Server Publishing Infraestructure. Mostrar todas las entradas

jueves, 31 de mayo de 2012

Tips/info #25 Sharepoint 2010

1-Actualizar los mails de las solicitudes de acceso para todos los sites de un web application mediante powershell

$webapp = Get-SPWebApplication "http://webapplication"
foreach($site in $webapp.Sites)
{
foreach($web in $site.AllWebs)
{
Write-Host $web.url
if(!$web.HasUniquePerm)
{
Write-Host "La solicitud de acceso hereda del elemento padre"
}
else
{
$web.RequestAccessEmail = "emailrequest@emailHost.com"
$web.Update()
Write-Host " Email cambiado"
}
}
}




2-Conducta de comportamiente para abrir documentos : open in the client application


DocShare3


$site=Get-SPSite "http://sitio/"
$web=$site.RootWeb
$docLibrary =$web.Lists["libreria"]
# abre en el cliente
docLibrary.DefaultItemOpen = DefaultItemOpen.PreferClient;
$docLibrary.Update()


Se puede usar:


// Abrir en el navegador
docLibrary.DefaultItemOpen = DefaultItemOpen.Browser;

// usa la configuración default
docLibrary.DefaultItemOpenUseListSetting = false;

3-Error: The web application at [URL] could not be found. Verify that you have typed the url correctly. If the url should be serving existing content, the system administrator may need to add a new request url mapping to the intended application.


Agrega la [url] que menciona el error al alternate access mapping del web application correspondiente.


4-Site collection bloquear su contenido


Para setear un Lock (bloqueo):
stsadm -o setsitelock -url <Site-collection-url> -lock <Lock-Type>


Para verificar los bloqueo actuales:
stsadm -o getsitelock -url <Site-collection-url>


donde<Lock-Type> puede tener los siguientes valores:


  • none  - Remueve todos los bloqueos
  • noadditions  - Previene de agregar contenido
  • readonly – No puede agregar/actualizar/borrar contenido
  • noaccess – No se puede ver el sitio de ninguna manera

    5-Algunas funciones útiles de SPServices


    Columnas de tipo personas o grupo, o columnas de tipo lookup


    Al usar estos campos, la información que se retorna es de la siguiente manera:  110;#4540152 o 16;#Departamento de Sistemas


    Podrás usar la siguiente función:

    function AjustarOWS(value){
    stringValue = value.indexOf(";#");
    salida = value.substring(stringValue +2);
    theLen = salida.length;
    if (theLen < 8){salida = "Not Listed"}else{salida}
    return salida;
    }



    Se podrá usar con SPServices de la siguiente manera:

    var depSistemas = ajustarOWS($(this).attr("ows_DepartamentoSistemas"));

    6-Error al mover o copiar una document set vía programación: DocID: Site prefix not set.

    $site = Get-SPSite http://host/sites/yoursite
    $properties = $site.RootWeb.Properties

    if ($properties["docid_msft_hier_siteprefix"] -eq $null)
    {
    $properties["docid_msft_hier_siteprefix"] = ""
    $properties.Update()
    }
    7-Remover una sección inválida del web.config mediante PowerShell

    $webapplication = Get-SPwebapplicationlication http://url de la web application
    $modification = $webapplication.WebConfigModifications | where { $_.Name -eq "<el nombre de la key" }
    $webapplication.WebConfigModifications.Remove($modification)
    $webapplication.Update()


    8-Error: Object Reference not set to an instance of an object with Timer Job Definitions al tratar de ingresar a http://<CA URL>/_admin/ServiceJobDefinitions.aspx


    El error nos informa en el event viewer:


    “There was an exception loading job definition "Microsoft.Office.Project.Server.Administration.ServerScheduledTimerJob" (id "r3u7f3gd-721b-5dcd-1135-fb3456e39425"). Object reference not set to an instance of an object.”


    abro una consola de powershell y hago lo siguiente:



    • get-sptimerjob | where-object {$_.name -like "PWA*"} | format-list name, id
    • disable-sptimerjob r3u7f3gd-721b-5dcd-1135-fb3456e39425

    9-Comandos de powershell para trabajar con features de Sharepoint


  • #Feature mostrada por nombre alfabeticamente
    Get-SPFeature | Sort -Property DisplayName


    #Feature mostrada por nombre alfabeticamente y agrupada por scope
    Get-SPFeature | Sort -Property Scope,DisplayName | FT -GroupBy Scope DisplayName,Id


    #exportar el resultado
    Get-SPFeature | Sort -Property Scope,DisplayName | FT -GroupBy Scope DisplayName,Id > c:\resultados.txt


    #Features del sitio correspondiente  ordenada por displayname y agrupadas por displayname y ID
    Get-SPFeature -Site http://sitecollectionurl | Sort DisplayName | FT DisplayName,Id


    10-No aparece la opción de “Spell Checker” en la ribbon


    Hay que activar la feature SharePoint Server Publishing Infrastructure a nivel del site collection


    SpellChecker_thumb



    11-Asignar permisos mediante client object


    http://alancejacob.wordpress.com/2012/05/30/programmatically-assign-permission-to-sharepint-list-for-specific-users/


    12-Modificar las columnas created by (creado por) y modified by (modificado por) con Client Object


    http://alancejacob.wordpress.com/2012/05/30/add-listitem-in-created-bymodified-by-field-sharepoint-2010-client-object-model/


    13-Obtener un icono de la carpeta 14 con SPUtility


    http://blogs.msdn.com/b/knackpoint/archive/2012/05/13/fetching-document-file-icons-in-sharepoint.aspx