martes, 30 de abril de 2013

Creating a Site Collection with PowerShell


Once you have your web application provisioned, you will need to create a site collection with a top level site. The New-SPSite cmdlet allows you to create a new top level site with the URL and owner specified in the –URL and –OwnerAlias. You will also notice that we have the ability to configure our tenant administration. In fact, in order to configure multi-tenants, you must use PowerShell. The site templates available in SharePoint Foundation include the following:

List with > Get-SPWebTemplate
  • GLOBAL#0             Global template
  • STS#0                Team Site
  • STS#1                Blank Site
  • STS#2                Document Workspace
  • MPS#0                Basic Meeting Workspace
  • MPS#1                Blank Meeting Workspace
  • MPS#2                Decision Meeting Workspace
  • MPS#3                Social Meeting Workspace
  • MPS#4                Multipage Meeting Workspace
  • CENTRALADMIN#0       Central Admin Site
  • WIKI#0               Wiki Site
  • BLOG#0               Blog
  • SGS#0                Group Work Site
  • TENANTADMIN#0        Tenant Admin Site
  • ACCSRV#0             Access Services Site
  • ACCSRV#1             Assets Web Database
  • ACCSRV#3             Charitable Contributions Web Database
  • ACCSRV#4             Contacts Web Database
  • ACCSRV#6             Issues Web Database
  • ACCSRV#5             Projects Web Database
  • BDR#0                Document Center
  • OFFILE#0             (obsolete) Records Center
  • OFFILE#1             Records Center
  • OSRV#0               Shared Services Administration Site
  • PowerPointBroadca... PowerPoint Broadcast Site
  • PPSMASite#0          PerformancePoint
  • BICenterSite#0       Business Intelligence Center
  • SPS#0                SharePoint Portal Server Site
  • SPSPERS#0            SharePoint Portal Server Personal Space
  • SPSMSITE#0           Personalization Site
  • SPSTOC#0             Contents area Template
  • SPSTOPIC#0           Topic area template
  • SPSNEWS#0            News Site
  • CMSPUBLISHING#0      Publishing Site
  • BLANKINTERNET#0      Publishing Site
  • BLANKINTERNET#1      Press Releases Site
  • BLANKINTERNET#2      Publishing Site with Workflow
  • SPSNHOME#0           News Site
  • SPSSITES#0           Site Directory
  • SPSCOMMU#0           Community area template
  • SPSREPORTCENTER#0    Report Center
  • SPSPORTAL#0          Collaboration Portal
  • SRCHCEN#0            Enterprise Search Center
  • PROFILES#0           Profiles
  • BLANKINTERNETCONT... Publishing Portal
  • SPSMSITEHOST#0       My Site Host
  • ENTERWIKI#0          Enterprise Wiki
  • SRCHCENTERLITE#0     Basic Search Center
  • SRCHCENTERLITE#1     Basic Search Center
  • SRCHCENTERFAST#0     FAST Search Center
  • visprus#0            Visio Process Repository

The Cmdlet


New-SPSite [-Url] <String> -OwnerAlias <SPUserPipeBind> [-AdministrationSiteType <None | TenantAdministration>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-ContentDatabase <SPContentDatabasePipeBind>] [-Description <String>][-HostHeaderWebApplication <SPWebApplicationPipeBind>] [-Language <UInt32>] [-Name <String>] [-OwnerEmail <String>] [-QuotaTemplate <SPQuotaTemplatePipeBind>] [-SecondaryEmail <String>] [-SecondaryOwnerAlias <SPUserPipeBind>] [-SiteSubscription <SPSiteSubscriptionPipeBind>] [-Template <SPWebTemplatePipeBind>] [-WhatIf [<SwitchParameter>]] [<CommonParameters>]

The Script


$siteURL http://lab.ps4sp.com&#8221;
$owner “PS4SPShannon”
$secondOwner “PS4SPAdministrator”
$template “STS#0″
$description “This is a sample site that was built using PowerShell.”
New-SPSite $siteURL -OwnerAlias $owner -SecondaryOwnerAlias $secondOwner -name “PowerShell for SharePoint” -Template $template -Description$description

lunes, 29 de abril de 2013

This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator.


I'm upgrade my sp 2007 to sp 2010 and I have a form library has more then 5000 items. Default view of form library filter items and show only 10-20 item to users.
After upgrade sp2010 All users get below error when going to form library expect site collection admins.
We get the error:
This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator.

To view items, try selecting another view or creating a new view. If you do not have sufficient permissions to create views for this list, ask your administrator to modify the view so that it conforms to the list view threshold.


Solution
The setting for the list throttle
  • Open the SharePoint Central Administration,
  • go to Application Management --> Manage Web Applications
  • Click to select the web application that hosts your list (eg. SharePoint - 80)
  • At the Ribbon, select the General Settings and select Resource Throttling
  • Then, you can see the 5000 List View Threshold limit and you can edit the value you want.
  • Click OK to save it.

viernes, 26 de abril de 2013

Listar features activas en una site collection

En algunos casos necesitamos listar las features activas, incluso las que están ocultas para solucionar algún problema.

Para listar todas las features podemos ejecutar la siguiente línea:


Get-SPFeature -Site http://sitecollectionurl | Sort DisplayName | FT DisplayName,Id

Como ver todas las site collections de una content DB especifica

Usando SharePoint Managment Shell podemos listar todas las site collections de una content database especifica, con el comando:

Get-SPSite -Limit All  -ContentDatabase contentdbname | select url, @{label="Size";Expression={$_.usage.storage}}

an unhandled exception occurred in the silverlight application sharepoint 2010



In SharePoint 2010 you may recieve the error "an unhandled exception occurred in the silverlight application sharepoint 2010" on sites which have been upgraded. This will generally occur when trying to create new Lists, Libraries, Sites or Pages. This happens because silverlight is unable to connect to the Windows Communication Foundation endpoint for enabling the Client Object Model, if Security validation is Off. To resolve the problem navigate to Central Administration and enable the Web Page Security Validation for the Web Application. Do the following:

  1. Open Central Administration
  2. Select Application Management
  3. Select Manage Web Applications
  4. Select the Web Application where the error occurs
  5. In the ribbon, select General Settings
  6. In the Web Application General Settings dialog box, find Web Page Security Validation and select On

martes, 23 de abril de 2013

Error al intentar activar la feature Sharepoint Server Publishing

Hoy nos pasó que al intentar activar la feature 'Sharepoint Server Publishing' en uno de los sitios nos daba error. En el servidor teniamos el Event ID: 4965

Para resolver el caso lo primero que tenemos que tener presente es que al activar la feature se crean las listas y librerias:
  • Documents
  • Images
  • Pages
  • Workflows Task
Entonces cuando intentamos activar 'Sharepoint Server Publishing', intenta crear los elementos mencionados.  Verificamos si estos elementos están creados, hacemos un backup de su contenido, luego borramos los elementos (Documents, Images, Pages, Workflows Task) y a continuación activamos la feature sin problemas. 

miércoles, 10 de abril de 2013

Stsadm to PowerShell cmdlet

PowerShell cmdlets STSADM Commands
Enable-SPFeature Activatefeature
Enable-SPInfoPathFormTemplate Activateformtemplate
New-SPAlternateUrl Addalternatedomain
Mount-SPContentDatabase Addcontentdb
 
New-SPContentDatabase
Install-SPDataConnectionFile Adddataconnectionfile
New-SPExcelFileLocation Add-ecsfiletrustedlocation
New-SPExcelDataProvider Add-ecssafedataprovider
New-SPExcelDataConnectionLibrary Add-ecstrusteddataconnectionlibrary
New-SPExcelUserDefinedFunction Add-ecsuserdefinedfunction
Add-SPInfoPathUserAgent Addexemptuseragent
New-SPManagedPath Addpath
None Addpermissionpolicy
Add-SPSolution Addsolution
Install-SPWebTemplate Addtemplate
New-SPUser Adduser
Install-SPWebPartPack Addwppack
New-SPAlternateUrl Addzoneurl
Set-SPInfoPathWebServiceProxy Allowuserformwebserviceproxy
 
Use the AllowForUserForms andIdentity parameters.
Set-SPInfoPathWebServiceProxy Allowwebserviceproxy
 
Use the AllowWebServiceProxy andIdentity parameters.
Set-SPWebApplication Authentication
 
Use the AuthenticationMethod orAuthenticationProvider parameters.
Backup-SPConfigurationDatabase Backup
 
Backup-SPFarm
 
Backup-SPSite
Get-SPBackupHistory Backuphistory
New-SPCentralAdministration Createadminvs
New-SPSite Createsite
New-SPSite Use the ContentDatabase parameter. Createsiteinnewdb
 
New-SPContentDatabase
New-SPWeb Createweb
Disable-SPFeature Deactivatefeature
Disable-SPInfoPathFormTemplate Deactivateformtemplate
Remove-SPAlternateUrl Deletealternatedomain
Remove-SPConfigurationDatabase Deleteconfigdb
Dismount-SPContentDatabase Deletecontentdb
Remove-SPManagedPath Deletepath
Remove-SPSite Deletesite
Remove-SPSolution Deletesolution
Uninstall-SPWebTemplate Deletetemplate
Remove-SPUser Deleteuser
Remove-SPWeb Deleteweb
Uninstall-SPWebPartPack Deletewppack
Remove-SPAlternateUrl Deletezoneurl
Install-SPSolution Deploysolution
Install-SPWebPartPack Deploywppack
Get-SPSolution Displaysolution
Set-SPContentDeploymentPath Editcontentdeploymentpath
Get-SPAlternateURL Enumalternatedomains
Get-SPContentDatabase Enumcontentdbs
Get-SPDataConnectionFileDependent Enumdataconnectionfiledependants
Get-SPDataConnectionFile Enumdataconnectionfiles
Get-SPInfoPathUserAgent Enumexemptuseragents
Get-SPInfoPathFormTemplate Enumformtemplates
Get-SPServiceInstance Enumservices
Get-SPSiteAdministration (To run this cmdlet, you must be a member of the Farm Administrators group.) Enumsites
 
Get-SPSite (To run this cmdlet, you must be a local administrator on the computer where SharePoint 2010 Products is installed.)
Get-SPSolution Enumsolutions
Get-SPWeb Enumsubwebs
Get-SPWebTemplate Enumtemplates
Get-SPUser Enumusers
Get-SPWebPartPack Enumwppacks
Get-SPAlternateURL Enumzoneurls
Start-SPAdminJob Execadmsvcjobs
Export-SPWeb Export
New-SPWebApplication Extendvs
New-SPWebApplicationExtension Extendvsinwebfarm
Get-SPWebApplication Getadminport
 
Use the following syntax:
 
Get-SPWebApplication -IncludeCentralAdministration | ? {$_.IsAdministrationWebApplication -eq $true}
 
Get-SPDataConnectionFile Getdataconnectionfilepropertyproperty
 
Use the following syntax:
 
Get-SPDataConnectionFile | where {$_.Name -eq "dataConFileName"} | format-list
 
Get-SPInfoPathFormTemplate Getformtemplateproperty property
 
Use the following syntax:
 
Get-SPInfoPathFormTemplate | where {$_.DisplayName -eq "formTemplateName"} | format-list
 
Get-SPFarmConfig Getproperty
 
Get-SPTimerJob
 
Disable-SPTimerJob
 
Enable-SPTimerJob
 
Set-SPTimerJob
 
Start-SPTimerJob
Get-SPSiteAdministration Getsitelock
Get-SPAlternateURL Geturlzone
Import-SPWeb Import
Install-SPFeature Installfeature
Get-SPLogLevel Listlogginglevels
Get-SPEnterpriseSearchSecurityTrimmer Listregisteredsecuritytrimmers
Move-SPSite Mergecontentdbs
Move-SPUser Migrateuser
For the Osearch parametersfarmcontactemail,farmperformancelevel,farmserviceaccount, andfarmservicepassword, use the Get-SPEnterpriseSearchService and Set-SPEnterpriseSearchService cmdlets. Osearch
 
For the Osearch parameters start andstop, use the Start-SPEnterpriseSearchServiceInstanceand Stop-SPEnterpriseSearchServiceInstance cmdlets, respectively.
 
For the Osearch parameterdefaultindexlocation, use the Get-SPEnterpriseSearchServiceInstance and Set-SPEnterpriseSearchServiceInstance cmdlets.
Use the Get-SPEnterpriseSearchServiceApplicationcmdlet to retrieve the specific Search service application, and then useDiacriticSensitive parameter from theSet-SPEnterpriseSearchServiceApplication cmdlet. Osearchdiacriticsensitive
Start-SPServiceInstance Provisionservice
Stop-SPInfoPathFormTemplate Quiesceformtemplate
Update-SPInfoPathFormTemplate Reconvertallformtemplates
New-SPEnterpriseSearchSecurityTrimmer Registersecuritytrimmer
Uninstall-SPDataConnectionFile Removedataconnectionfile
Remove-SPExcelFileLocation Remove-ecsfiletrustedlocation
Remove-SPExcelDataProvider Remove-ecssafedataprovider
Remove-SPExcelDataConnectionLibrary Remove-ecstrusteddataconnectionlibrary
Remove-SPExcelFileLocation Remove-ecsuserdefinedfunction
Remove-SPInfoPathUserAgent Removeexemptuseragent
Uninstall-SPInfoPathFormTemplate Removeformtemplate
Rename-SPServer Renameserver
Set-SPSite Renamesite
 
Use the Url parameter.
Set-SPWeb Renameweb
 
Use the RelativeUrl parameter.
Restore-SPFarm Restore
 
Restore-SPSite
Uninstall-SPSolution Retractsolution
Start-SPContentDeploymentJob Runcontentdeploymentjob
Install-SPFeature Scanforfeatures
 
Use the Scanforfeatures parameter.
Set-SPCentralAdministration Setadminport
Connect-SPConfigurationDatabase Setconfigdb
Set-SPContentDeploymentJob Setcontentdeploymentjobschedule
Set-SPDataConnectionFile Setdataconnectionfileproperty
Set-SPExcelFileLocation Set-ecsexternaldata
Set-SPExcelServiceApplication Set-ecsloadbalancing
 
Use the LoadBalancingSchemeparameter.
Set-SPExcelServiceApplication Set-ecsmemoryutilization
 
Use the MemoryCacheThreshold andPrivateBytesMax parameters.
Set-SPExcelServiceApplication Set-ecssecurity
 
Use the CrossDomainAccessAllowed,EncryptedUserConnectionRequired, and FileAccessMethod parameters.
Set-SPExcelServiceApplication Set-ecssessionmanagement
 
Use the SessionsPerUserMax andSiteCollectionAnonymousSessionsMaxparameters.
Set-SPExcelServiceApplication Set-ecsworkbookcache
 
Use the Workbookcache andWorkbookCacheSizeMax parameters.
Set-SPInfoPathFormTemplate Setformtemplateproperty
Set-SPLogLevel Setlogginglevel
Set-SPFarmConfig Setproperty
 
Get-SPTimerJob
 
Disable-SPTimerJob
 
Enable-SPTimerJob
 
Set-SPTimerJob
 
Start-SPTimerJob
Set-SPSiteAdministration Setsitelock
 
Use the LockState parameter.
Get-SPSiteSubscription Setsiteuseraccountdirectorypath
 
New-SPSiteSubscription
 
Remove-SPSiteSubscription
Set-SPWorkflowConfig Setworkflowconfig
Set-SPSiteAdministration Siteowner
Install-SPSolution Syncsolution
 
Use the Synchronize parameter.
Remove-SPWebApplication Unextendvs
Uninstall-SPFeature Uninstallfeature
Start-SPInfoPathFormTemplate Unquiesceformtemplate
Remove-SPEnterpriseSearchSecurityTrimmer Unregistersecuritytrimmer
Set-SPManagedAccount Updateaccountpassword
Install-SPInfoPathFormTemplate Upgradeformtemplate
Update-SPSolution Upgradesolution
Install-SPInfoPathFormTemplate Uploadformtemplate
Get-SPUser Userrole
 
Move-SPUser
 
New-SPUser
 
Remove-SPUser
 
Set-SPUser
Test-SPInfoPathFormTemplate Verifyformtemplate
   
Not made into PowerShell cmdlets  
Binddrservice  
Blockedfilelist  
Canceldeployment  
Changepermissionpolicy  
Copyappbincontent  
Creategroup  
Databaserepair  
Deleteadminvs  
Deletegroup  
Deletepermissionpolicy  
Disablessc  
Email  
Enablessc  
Enumdeployments  
Enumgroups  
Enumroles  
Forcedeletelist  
Getosearchsetting  
Getsiteuseraccountdirectorypath  
Listqueryprocessoroptions  
Localupgradestatus  
Managepermissionpolicylevel  
Quiescefarm  
Quiescefarmstatus  
Refreshdms  
Refreshsitedms  
Registerwsswriter  
Removedrservice  
Removesolutiondeploymentlock  
Retractwppack  
Setapppassword  
Setosearchsetting  
Setqueryprocessoroptions  
Unquiescefarm  
Unregisterwsswriter  
Updatealerttemplates  
Updatefarmcredentials  
Upgrade  
Upgradetargetwebapplication