Showing posts with label SharePoint 2013. Show all posts
Showing posts with label SharePoint 2013. Show all posts

Friday, May 2, 2014

SharePoint Admin Roles

In a nutshell, the SharePoint Administrator should be responsible for some activities. In the table below I tried to split the customer and the SharePoint Admin roles.

Feel comfortable to share your opinion.

:-)

Simple Responsabilty Matrix for SharePoint Roles:

STEP ACTIVITY DESCRIPTION PERFORMED BY SP TEAM PERFORMED BY THE CUSTOMER
1 SharePoint Farm configuration X  
2 SharePoint Farm Administration X  
3 SharePoint Services Application configuration X  
4 Development of Worflows   X
5 Development of solutions   X
6 Deploy of solutions X  
7 Give the appropriate site collection permissions (First and Second SC Adm) X  
8 Aditional site collection permissions   X
9 Managing SharePoint sites permissions   X
10 Create Web Applications X  
11 Create Site Collections X  
12 Provide the Architeture of farm   X
13 Provide the Architeture of Services Applications   X
14 Troubleshooting SharePoint infrastructure problems X  
15 Edit web.config files   X
16 Update web.config file (copy web.config file to its application) X  
17 Responsible for management the web application content   X
18 Provide the infrastructure to Backup the Farm X  
19 Performe Backup/Restore the Farm X  
20 Performe Backup/Restore of Site Collections X  
21 Performe moving/copying sites X  
22 Managing and checking the overall server health and functionality X  
23 Setting up auditing for SharePoint Site Collections   X
24 Guidance for governance of SharePoint farms and Web Applications   X
25 Guidance for Site Collections Quotas   X
26 Setting up quotas for Site Collections X  
27 Apply SharePoint patches and cumulative updates X  
28 Request to apply SharePoint patches and cumulative updates   X
29 Regularly analyzing SharePoint content and storage X  
30 Monitoring SharePoint trends (e.g. site usage and growth, disk space usage and growth) X  
31 Setting up alerts and enforcing policies X  
32 Guidance for alerts and enforcing policies   X
33 Update binaries for some application (copy files to some application) X  
34 Edit binaries for some application (files to some application)   X
35 Write PowerShell Scripts to manage SharePoint X  

Monday, April 14, 2014

How to configure PowerPivot on SharePoint 2013

Hello Everybody,

Last week I studied about how to configure, get it working and test the PowerPivot on SharePoint 2013.

The best tutorial I found was at the link http://technet.microsoft.com/en-us/library/dn456880(v=office.15).aspx

I have downloaded and published the video directly here: https://www.youtube.com/watch?v=n9Qsxl3GZYk

On this post I added some configurations that not are included in this video:

1) Excel Services Configuration:

1.1 I have created an Site Collection called “BICenter” within my web application  http://portal.mabotega.local. The complete URL was http://portal.mabotega.local/sites/BICenter;

1.2 I added the BICenter Document Library (in my scenario: http://portal.mabotega.local/sites/BICenter/Documents) on the “Trusted File Locations” on the Excel Services Application configuration. For to do it, click on the “Manage Application Services” within “Application Management” section:

image

1.3 Click on “Excel Service Application”

image

1.4 Click on the “Trusted File location” link:

image

1.5 Add the Document Library address at the “Address’ field: http://portal.mabotega.local/sites/BICenter and Check the “Children Trusted”, and confirm in “Ok” button:

image

The result will be like this:

image

2) PowerPivot Permisions:

2.1 Run the PowerShell below changing for the appropriated values for your environment:

In my scenario I have used the URL: http://portal.mabotega.local

$w = Get-SPWebApplication -identity http://portal.mabotega.local

#this is the application pool account that runs the PowerPivot Service Application in my scenario

$w.GrantAccessToProcessIdentity(“MABOTEGA\RBTSHPSR10″)

2.2 Be sure if the command worked well:

Open the SQL Server Management Studio;

Expand Security –> Logins;

Double click on your PowerPivot application pool account (in my scenario MABOTEGA\RBTSHPSR10);

Select User Mapping;

In the “User mapped to this login” session, select the content database for your application. In my scenario http://portal.mabotega.local, content database DBSPS_Portal_Content;

In the “Database role membership for: DBSPS_Portal_Content” session, make sure that the “SPDataAccess” role is selected:

image

3) Secure Store Service Application

3.1 Select your “Secure Store Service Application” and set the appropriated Unattended user account to be used by Excel Service to get information on PowerPivot. In my scenario MABOTEGA\RBTSHPSR11. The Owner of this credential is the user account that will run the PowerPivot Application Pool, in my scenario MABOTEGA\RBTSHPSR10:

image

3.2 Open the SQL Server Management Studio;

Expand Security –> Logins;

Double click on your U accounattended account (in my scenario MABOTEGA\RBTSHPSR11);

Select User Mapping;

In the “User mapped to this login” session, select the content database that is get information. In my scenario I have followed the sample in the Microsoft video and I called the “Cities”. In the “Database role membership for: Cities” session, make sure that the “db_datareader” role is selected:

image

That’s it for now!

Saturday, April 5, 2014

Create Managed Metadata Service Application via PowerShell in SharePoint 2013

In this article, we will go through the steps to create Managed Metadata.

There are four steps which are:

1) Plan whether to use a dedicated application pool or a shared one based on various factors

To find out the application pool’s exists in your environment, try this in SharePoint PowerShell Management Console

Get-SPServiceApplicationPool

To get the list of managed accounts,

Get-SPManagedAccount

To create a new application pool with dedicated managed service account:

New-SPServiceApplicationPool -Name ManagedMetaDataAppPool -Account Domain\managedmetadata_svc

If you intend to use an existing app pool, change the name below.

2) Create the Managed Metadata Service Application:

New-SPMetadataServiceApplication -Name “MetadataServiceApp” -ApplicationPool “AppPool_MMS” -DatabaseName “MetadataDB”

3) Create the Managed Metadata Service Application Proxy

New-SPMetadataServiceApplicationProxy -Name “MetadataServiceProxy” -ServiceApplication “POFPROD_MetadataServiceApp” -DefaultProxyGroup

4) Configure the Service Application Association:

Add Managed Metadata in Service Application Association with the required Web Application manually.

We would use Power Shell given any day as I can keep the databases clean without any GUID’s.

References: http://technet.microsoft.com/en-us/library/ff607557(v=office.15).aspx

Upgrade the Managed Metadata Service Application

1) Start the MMS service instance

The following procedures start the service instance of MMS.

To start service application instances from Central Administration
  1. Start SharePoint 2013 Central Administration.

    • For Windows Server 2008 R2:

      • Click Start, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Central Administration.

    • For Windows Server 2012:

      • On the Start screen, click SharePoint 2013 Central Administration.

        If SharePoint 2013 Central Administration is not on the Start screen:

      • Right-click Computer, click All apps, and then click SharePoint 2013 Central Administration.

    For more information about how to interact with Windows Server 2012, see Common Management Tasks and Navigation in Windows Server 2012.

  2. In SharePoint 2013 Central Administration, on the Application Management page, in the Service Applications section, click Manage Services on Server.

  3. Next to the Managed Metadata Web Service, click Start.

2) Upgrade the MMS

To upgrade the Managed Metadata service application, you create the new service application and upgrade the database, and then create a proxy and add it to the default proxy group. You must upgrade the Managed Metadata service application before you can upgrade the User Profile service application.

To upgrade the Managed Metadata service application by using Windows PowerShell
  1. Verify that you have the following memberships:

    • securityadmin fixed server role on the SQL Server instance.

    • db_owner fixed database role on all databases that are to be updated.

    • Administrators group on the server on which you are running the Windows PowerShell cmdlets.

    An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 cmdlets.

    note Note:

    If you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about Windows PowerShell permissions, see Add-SPShellAdmin.

  2. Start the SharePoint 2013 Management Shell.

    • For Windows Server 2008 R2:

      • On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Management Shell.

    • For Windows Server 2012:

      • On the Start screen, click SharePoint 2013 Management Shell.

        If SharePoint 2013 Management Shell is not on the Start screen:

      • Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.

    For more information about how to interact with Windows Server 2012, see Common Management Tasks and Navigation in Windows Server 2012.

  3. To store the application pool that you want to use as a variable for this service application, at the Windows PowerShell command prompt, type the following command:

    Windows PowerShell

    $applicationPool = Get-SPServiceApplicationPool -Identity 'SharePoint Web Services default'

    Where:



    • SharePoint Web Services default is the name of the service application pool that will contain the new service applications.


    This cmdlet sets the service application pool as a variable that you can use again in the cmdlets that follow. If you have multiple application pools and have to use a different application pool for a particular service application, repeat this step in the procedure to create each service application to use the appropriate application pool.



  4. To upgrade the Managed Metadata service application, at the Windows PowerShell command prompt, type the following command:

    Windows PowerShell

    $mms = New-SPMetadataServiceApplication -Name 'Managed Metadata Service Application' -ApplicationPool $applicationPool -DatabaseName 'Managed Metadata Service_DB'

    Where:



    • Managed Metadata Service Application is the name that you want to give the new Managed Metadata service application.



    • $applicationpool is the variable that you set earlier to identify the service application pool to use.

      TipTip:

      If you do not use the variable $applicationPool, then you must specify the name of an existing service application pool in the format ‘Application Pool Name‘. To view a list of service application pools, you can run the Get-SPServiceApplicationPool cmdlet.



    • Managed Metadata Service_DB is name of the service application database that you want to upgrade.


    This command sets a variable, $mms, that you use when you create the proxy later.

    For more information, see New-SPMetadataServiceApplication.



  5. At the Windows PowerShell command prompt, type the following command to create a proxy for the Managed Metadata service application:

    Windows PowerShell

    New-SPMetadataServiceApplicationProxy -Name ProxyName -ServiceApplication $mms -DefaultProxyGroup

    Where:



    • ProxyName is the proxy name that you want to use.



    • $mms is the variable that you set earlier to identify the new Managed Metadata service application.

      TipTip:

      If you do not use the variable $mms, then you must use an ID to identify the Managed Metadata service application proxy instead of a name. To find the ID, you can run the Get-SPServiceApplication cmdlet to return a list of all service application IDs.



    • DefaultProxyGroup adds the Managed Metadata service application proxy to the default proxy group for the local farm.


    For more information, see New-SPMetadataServiceApplicationProxy.


Reference: http://technet.microsoft.com/en-us/library/jj839719(v=office.15).aspx

That’s it for now!

Thursday, April 3, 2014

Import-SPMetadatawebservicePartitionData / You do not have permission to use the bulk load statement

During a Term store import, you can incurr in a “Import-SPMetadataWebServicePartitionData: You do not have permission to use the bulk load statement”.

So the workaround is to add service account to BULK ADMIN role when you want to import the term store and remove it after operation is complete.

bulkadmin

Tuesday, April 1, 2014

SharePoint 2013 Build Numbers

Just another post like this kind…

Build Number Build Name Component Information Link Download Link
15.0.4128.1014 Beta SharePoint Foundation 2013   Download
15.0.4128.1014 Beta SharePoint Server 2013   Download
15.0.4128.1014 Beta Project Server 2013   Download
​15.0.4420.1017 ​RTM ​​SharePoint Foundation 2013 ​Download
​​15.0.4420.1017 ​RTM ​SharePoint Server 2013 ​Download
​​15.0.4420.1017 ​RTM ​Project Server 2013 ​Download
​15.0.4433.1506 ​December 2012 Hotfix ​SharePoint Server 2013 ​KB2752058 ​Download
​15.0.4433.1506 ​December 2012 Hotfix ​SharePoint Server 2013 (coreserver) ​KB2752001 ​Download
​15.0.4481.1005 ​March 2013 Public Update ​SharePoint Foundation 2013 ​KB2768000 ​Download
​​15.0.4481.1005 ​​March 2013 Public Update ​SharePoint Server 2013 ​KB2767999 ​Download
​​15.0.4481.1005 ​​March 2013 Public Update ​Project Server 2013 ​KB2768001 ​Download
​15.0.4505.1002 ​April 2013 CU ​​SharePoint Foundation 2013 ​KB2751999 ​Download
​15.0.4505.1005 ​​April 2013 CU ​SharePoint Server 2013 ​KB2726992 ​Download
​15.0.4505.1005 ​April 2013 CU ​Project Server 2013 ​KB775426 ​Download
​15.0.4517.1003 ​June 2013 CU ​SharePoint Foundation 2013 ​KB2817346 ​Download
​15.0.4517.1005 ​June 2013 CU ​​SharePoint Server 2013 ​KB2817414 ​Download
​June 2013 CU ​Project Server 2013 ​KB2817415 ​Download
​15.0.4535.1000 ​August 2013 CU ​​SharePoint Foundation 2013 ​KB2817517 ​Download
​​August 2013 CU ​SharePoint Server 2013 ​KB2817616 ​Download
​​August 2013 CU ​Project Server 2013 ​KB2817615 ​Download
​15.0.4551.1001 ​October 2013 CU ​SharePoint Foundation 2013 ​KB2825674 ​Download
​15.0.4551.1005 ​October 2013 CU ​SharePoint Server 2013 ​KB2825647 ​Download
​October 2013 CU ​Project Server 2013
​15.0.4551.1508 ​December 2013 CU ​SharePoint Foundation 2013 ​KB2849961 ​Download
​15.0.4551.1511 ​SharePoint Server 2013 ​KB2850024 ​Download
​15.0.4551.1508 ​Project Server 2013 ​KB2837668 ​Download
​15.0.4569.1000 ​Service Pack 1 ​SharePoint Foundation 2013 ​KB2817439 ​Download
​SharePoint Server 2013 ​KB2817429 ​Download
​Project Server 2013 ​KB2817434 ​Download
         

Friday, March 28, 2014

Thursday, March 27, 2014

SharePoint Products Configuration Wizard – Tip

When you will run the “SharePoint Products Configuration Wizard” on a farm that has large databases (greater than 100GB), it’s advisable to change the recovery mode of all SharePoint databases to simple mode, avoiding a possible storage overflow in database log files or disk unit.

After that, adjust the recovery mode of each database following your enterprise rules or the Microsoft recommendation at link http://technet.microsoft.com/en-us/library/cc678868(v=office.15).aspx

Cheers ;-)

Friday, March 7, 2014

Why SharePoint 2013 Content Database grows up fast?

Today (2014.03.07) my DBA colleague got my attention about the fast growth of one of the content database in our SharePoint 2013 farm.

The content DB was normally at 04GB but after something, its size was doubled.

growth1

So I started the verification and the first thing that I did was looking for with table inside my Content DB was taking most of the space.

You Can check it from the SQL Server Management Studio. Login to SQL Server Management Studio -> Select your Content DB (Right Click) -> Reports- > Standard Reports -> Disk Usage by Top Tables.

growth2

Our report says that the “dbo.AuditData” are taking most of the space inside Content database of our site collection:

growth3

My conclusion: if you have enabled something like view auditing, a search crawl that crawls all the content could increase database size because the audit entries are stored inside the content DB. Workflow history events and User Profiles Sync are also stored in the content db and could be another possible explanation for the “mysterious growth”.

I have checked what our customer had set up for Audit in his site, and I have seen that he had selected everything. So if you want to reduce it, you must to decide what really is important for you audit.

growth10

More references:

http://technet.microsoft.com/en-us/library/cc678868%28v=office.15%29.aspx

Session: Content database

Content database size estimation

Content database size varies significantly with the usage of the site. Growth factors include the number of documents, number of users, use of versioning, use of Recycle Bins, size of quotas, whether the audit trail is configured, and how many items are chosen for auditing.

If Power Pivot for SharePoint is being used, the Excel files stored in SharePoint Server grow larger, which increases the size of the content database. For more information, see Plan a PowerPivot Deployment in a SharePoint Farm.

For detailed recommendations about how to calculate the size of a content database, see Storage and SQL Server capacity planning and configuration (SharePoint Server 2013).

Monday, March 3, 2014

How to reduce the size of logging database and how to purge the old data from Logging Database

Depending what you have selected to log on SharePoint 2013 logs, the WSS logging database grows very fast and it cause the storage problem most of the time.

In SharePoint 2013, you can selectively collect the ULS and Windows event logs from all the servers in a farm to a central Usage and Health database. The default data retention period is 14 days and bellow, I have my own sample of events selection:

clip_image001

The Logging database stores the following things:

  • ULS Logs from 15 Hive\LOGS
  • Raw Resources Usage Data

clip_image002

There are two timer jobs used to import and to process the raw data in the database:

  1. Microsoft SharePoint Foundation Usage Data Import
  2. Microsoft SharePoint Foundation Usage Data Processing

clip_image003

clip_image004

By following PowerShell commands we can check and change the value of retention days for the events selected on this database:

Check settings:

Get-spusagedefinition

Change settings:

Set-SPUsageDefinition 

To reduce the size of the logging database and to purge the old data from the logging database we can follow these steps.

1. Check the retention’s days typing the PowerShell on a SharePoint 2013 Management Shell prompt as administrator:

Get-spusagedefinition

clip_image005

2. Find the Logging Database Name:

Login to Central Administration -> Monitoring -> Configure Usage and health data collection:

clip_image006

Check the name in the “Database Name” of the “Logging Database Server” section:

clip_image007

3. Now you need to find which table is taking most of the space inside the WSS logging Database.

You Can check the same from the SQL Server. Login to SQL Server Management Studio -> Select your logging Database (Right Click) -> Reports- > Standard Reports -> Disk Usage by Top Tables.

clip_image008

Our report says that the “dbo.RequestUsage_*” are taking most of the space inside WSS Logging database, so  you can bring down the retention period of  Page Request Event from 14 to 5 for example.

clip_image009

4. By following the PowerShell below, you will bring down the retentions period of the “Page Requests” from 14 to 5:

Set-SPUsageDefinition -Identity “Page Requests” -DaysRetained 5

clip_image010

5. Run again the PowerShell to check the new value was changed or not:

Get-spusagedefinition

clip_image011

6. After that we need to run the two timer jobs to clean the old data “Microsoft SharePoint Foundation Usage Data Import” and “Microsoft SharePoint Foundation Usage Data Processing”.

Go to Sharepoint Central Administration -> Monitoring -> Configure Usage and health data collection-> Log Collection Schedule:

clip_image003[1]

It will take you to the “Job Definitions” page:

clip_image004[1]

7. Now Click on both the Job Definitions one by one and hit ‘Run Now’ to run the timer jobs:

clip_image012

clip_image013

8. Check if the timer jobs have run with success for all servers of the farm:

clip_image014

9. Once the timer jobs had run with success, you can check and confirm database has released the space. Note that now, I don’t have “dbo.RequestUsage_Partition4″ and “dbo.RequestUsage_Partition3″. It have reduced almost 5GB on my storage.

clip_image015

Alternatively, you can choose bring down all definitions at once time. Below a sample to bring down all definitions to 1 day:

Get-SPUsageDefinition | ForEach-Object {Set-SPUsageDefinition -Identity $_.name -DaysRetained 1}

Once that’s finished, a plain Get-SPUsageDefinition command should confirm that everything’s been set to 1 day.

clip_image016

After that, you can use SQL tools to shrink the database back to a more manageable size on disk. (Reminder, you may not need to have the WSS_Logging database in fully-logged, full recovery mode, which generates larger SQL transaction logs. Simple recovery mode usually works best here and it is the MS recommendation).

You may consider in a large production environments that the best option is to move the Usage and Health database to a separate physical database server using the Powershell below or at least have a separated disk to host this database:

Set-SPUsageApplication -DatabaseServer <DatabaseServerName> -DatabaseName <DatabaseName> [-DatabaseUserName <UserName>] [-DatabasePassword <Password>] [-Verbose]

References:

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

http://technet.microsoft.com/en-us/library/cc678868(v=office.15).aspx

Thursday, February 27, 2014

PowerShell to check all the Farm Solutions Status different of “Deployed”

Initially, that solution was deployed with success on that farm, but for a weird reason that we couldn’t found out the why, that solution begun displaying an error on its status, as described on the screen shot below:

solutionerror

Based on this scenario, we decided to build a PowerShell to check all solutions status on our farms. If it find some solution with error status, it will create a log file pointing the name and the status of the solution and send by email this alert for the administrators.

Here is the PowerShell code:

####################

Add-PSSnapin Microsoft.SharePoint.PowerShell -EA 0

$ServerName = $env:computername

function sendMail($MailMSG) {
#Write-Host “Sending Email”
$attach = new-object Net.Mail.Attachment($MailMSG)

###First, the administrator must change the mail message values in this section
$FromAddress = “adm-web@sharepoint.com.br#change by your email address
$ToAddress = “adm-web@sharepoint.com.br”      #change by your email address

$MessageSubject = “$ServerName – Alert – Solution Undeployed on Farm”
#$MessageBody = $MailMSG
$MessageBody = “Please verify the attached”
$SendingServer = “smtp.yourcompany.com”         #change by your smt server
###Create the mail message
$SMTPMessage = New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress, $MessageSubject, $MessageBody
$SMTPMessage.Attachments.Add($attach)
###Send the message
$SMTPClient = New-Object System.Net.Mail.SMTPClient $SendingServer
$SMTPClient.Send($SMTPMessage)
$attach.dispose()
}

# Get current date and format it to avoid invalid characters such as “/” and “:”

$today=Get-Date -format “MM-dd-yyyy HH.mm.ss”

# Replace with your script location

$Location=”D:\Softwares\CheckFarmSolutionScript”

# Replace with your desired log file location + name

$logFile=”$Location\LogSOLUTIONS.log”

If (Test-Path $logFile){
Remove-Item $logFile -Confirm:$false
}

function List-Solutions()
{
$farm = Get-SPFarm
foreach ($solution in $farm.Solutions)
{

if($solution.Deployed -eq $false){
Write “Solution Verification started at $today” >>$logFile
Get-SPSolution -identity $solution.Name >>$logFile

}
}
}

#call the function List-Solutions

#test if the log file exists, If yes, send an email

If (Test-Path $logFile){

sendMail($logFile)

}
####################

Tuesday, February 11, 2014

SharePoint – PowerShell script to list all Webs and Site Templates

One more gequick post today, this PowerShell script will iterate through all Webs within a Site Collection, print out their Title, URL, WebTemplate (Site Template) name and it language.

#############################################

cls

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$site = Get-SPSite “http://mysite.mydomain.local

foreach ($web in $site.AllWebs) {

$web | Select-Object -Property Title,Url,WebTemplate,Language

}

$site.Dispose()

#############################################

Wednesday, February 5, 2014

LoopbackCheck – O que você deveria saber

O feature de segurança Loopback Security Check foi introduzido no Windows Server 2003 SP1 porque muitos exploits tentam a atacar o sistema operacional via “Reflect”. O Loopback Security Check bloqueia basicamente qualquer acesso no servidor a um site local ao usar o FQDN (fully qualified domain name) ou um host header personalizado.

Até aqui tudo bem, porém temos a situação que o SharePoint acessa as pagina locais, por exemplo na indexação da busca ou a consumir um dos próprios Web Services.

Nós podemos observar os seguintes eventos com Loopback Security Check habilitado:

No navegador ou no ULS:

HTTP 401.1 – Unauthorized: Logon Failed

E nos eventos do Windows:

Event Type: Failure Audit
Event Source: Security
Event Category: Logon/Logoff
Event ID: 537
Date: Date
Time: Time
User: NT AUTHORITY\SYSTEM
Computer: Computer_Name
Description: Logon Failure:
Reason: An error occurred during logon
User Name: User_Name
Domain: Domain_Name
Logon Type: 3
Logon Process: Ðùº
Authentication Package: NTLM
Workstation Name: Computer_Name
Status code: 0xC000006D
Substatus code: 0×0
Caller User Name: -
Caller Domain: -
Caller Logon ID: -
Caller Process ID: -
Transited Services: -
Source Network Address: IP_Address
Source Port: Port_Number

Eu vi muitas fazendas do SharePoint em produção com o Loopback Check desabilitado, ou veja vulnerável. Nós precisamos criar exceções em vez de desabilitar o recurso para as paginas do SharePoint para evitar os eventos acima seguindo o metodo 1 do KB896861.

Existem as seguintes formas para automatizar o procedimento:

Powershell

Substitue o valor SERVERNAME pelo endereço desejado

New-ItemProperty HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0 -Name “BackConnectionHostNames” -value “SERVERNAME” -PropertyType multivalue

Policy

O Harbar escreveu um artigo excelente sobre o assunto - http://www.harbar.net/archive/2010/02/12/groundhog-day-configuring-back-connection-host-names-using-group-policy.aspx

[]

David

SharePoint Support Engineer

Blog: http://spinternals.blogspot.com.br/

Friday, January 31, 2014

Export all the WSP solutions from SharePoint Farm With PowerShell

###############################################################################
## Purpose: Export WSPs from Solution Store to a folder definied by you                           

##    Usage:   .\ExportSolutions.ps1 -ExportPath “C:\Solutions” -Overwrite $true
###############################################################################

[CmdletBinding()]
Param(
[Parameter(Mandatory=$true,Position=1)]
[string]$ExportPath,
[Parameter(Mandatory=$true,Position=2)]
[bool]$Overwrite
)

function LoadSharePointPowerShellEnvironment
{
write-host “Setting up PowerShell environment for SharePoint” -foregroundcolor Yellow
write-host
Add-PSSnapin “Microsoft.SharePoint.PowerShell” -ErrorAction SilentlyContinue
write-host “SharePoint PowerShell Snapin loaded.” -foregroundcolor Green
write-host
}

LoadSharePointPowerShellEnvironment

$FinalPathExists = Test-Path $ExportPath
if($FinalPathExists)
{
$LocalFarm = Get-SPFarm -ErrorAction SilentlyContinue
if($LocalFarm -ne $null)
{
$FarmSolutions = $LocalFarm.Solutions
$Count = 0
foreach($Solution in $FarmSolutions)
{
if($Solution -ne $null)
{
$FinalPath = $ExportPath + “\” + $Solution.Name;
$FileExists = Test-Path $FinalPath
if($FileExists -and -not $Overwrite)
{
## If file exists and user does not want to overwrite, do nothing
}
else
{
Write-Host “Exporting solution to $FinalPath…” -ForegroundColor Yellow
Write-Host
$Solution.SolutionFile.SaveAs($FinalPath);
Write-Host “Exported solution to $FinalPath successfully.” -ForegroundColor Green
Write-Host
$Count++
}
}
}
Write-Host “Exported $Count WSP Solutions to $ExportPath.” -ForegroundColor Green
Write-Host
}
else
{
Write-Error “Local SharePoint farm not found.”
Write-Host
}
}
else
{
Write-Error “Path $ExportPath does not exist, please specify correct path.”
Write-Host
}

Friday, December 20, 2013

About Doubts / Dúvidas SharePoint Blogs Central Administration regional settings in sharepoint 2010/2013

To change Regional Setting in SharePoint 2010/2013 for Central Administration web site to check and receive the correct date and time format for the performed jobs.

Regional Settings are hidden for the Central Admin site collection. However, you can get it corrected, by typing the URL (substitute mysharepointserver:2010 for your central admin web application and port).

http://mysharepointserver:2010/_layouts/regionalsetng.aspx or

http://mysharepointserver:2013/_layouts/regionalsetng.aspx

2010:

regional2

2013:

regional1

How to enable the SharePoint 2010 and 2013 Developer Dashboard

Developer Dashboard is a great tool that will help you to gathering a lot of information about some application in your farm. It was reviewed and it received a huge number of improvements. Now, the Developer Dashboard panel, it’s no longer a control on your page which only shows you information about the current request. It’s now a separate window which shows you all requests since you started the developer dashboard session.

The new 2013 Developer Dashboard depends on the Usage and Health Data Collection Service Application. So, be sure to configure it before!

Notice that there are the following options for the Developer Dashboard:

  • On - SharePoint 2010: The Developer Dashboard will always be rendered at the bottom of each page SharePoint 2013: The Developer Dashboard icon will always be displayed at the top right corner. It will not be appended to each page.
  • Off – SharePoint 2010 & 2013: The Developer Dashboard will not be available
  • OnDemand – SharePoint 2010: The Developer Dashboard will only be appended to a page after clicking on the icon in the ribbon SharePoint. In SharePoint 2013, this mode was deprecated and replaced with On.

PowerShell

The dashboard can be enabled for your SharePoint 2010 or 2013 farm by executing the following commands in a SharePoint PowerShell window:

#Adding SharePoint Snapin
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#cleaning the screen
cls
$cs = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$dds = $cs.DeveloperDashboardSettings
write-host “Developer dashboard Status is: “$dds.DisplayLevel

if ($dds.DisplayLevel -eq “On”) {
Write-Host “Developer dashboard is enabled.”
write-host “Do you want do disable it? (Y/N)”
$aw = Read-Host
if ($aw -eq “Y”) {
$dds.DisplayLevel = “Off”
$dds.Update()
Write-Host “Developer dashboard disabled.”
}
} else {
Write-Host “Developer dashboard is disabled.”
write-host “Do you want do enable it? (y/n)”
$aw = Read-Host
if ($aw -eq “Y”) {
$dds.DisplayLevel = “On”
$dds.Update()
Write-Host “Developer dashboard enabled.”
}
}

After that PowerShell, if you have turned “on” the Developer Dashboard and you would like to check out how it works, You need to click on the developer dashboard icon in the upper right ribbon button and the new developer dashboard window opens.

devdash

Ok, that’s it. Have a good troubleshooting.

For more information on how to use the dashboard can be found in the excellent article at http://www.zimmergren.net/archive/2010/12/18/sp-2010-developing-for-performance-part-1-developer-dashboard.aspx, where the author, describe in details how to read the report for SharePoint 2010!

Sunday, December 15, 2013

Unexpected System.Configuration.ConfigurationErrorsException: The RSA key container could not be opened.

Scenario:

You have a SharePoint 2013 application that has a web part consulting a external database (not a SharePoint database) and you add inside the Tag <configuration>:

<connectionStrings>

<add name=”MyAnyWebPart” connectionString=”Data Source=DataBaseServer;Initial Catalog=DatabaseName;User ID=UserName;Password=XXXXXXX”
providerName=”System.Data.SqlClient” />

</connectionStrings>

After performing the inclusion of connectionString, it should be encrypted. This way, you will prevent the credentials are exposed when some error occur. The RSA encryption will be used, which is automatically generated by aspnet_regiis.exe module.

To perform this action, follow the steps below:

1 – Open the command prompt with administrative privileges
2 – Go to C:\Windows\Microsoft.NET\Framework64\v4.0.30319
3 – Run the following command to perform the encryption connectionString:

Encrypt:

aspnet_regiis.exe -pef ” connectionStrings ” “C:\inetpub\wwwroot\wss\VirtualDirectories\80″

Decrypt:

aspnet_regiis.exe -pdf “connectionStrings” “C:\inetpub\wwwroot\wss\VirtualDirectories\80″

Note: Use your SharePoint Application path.

At the end of encryption steps, the result will be similar to that shown below:

<connectionStrings configProtectionProvider=”RsaProtectedConfigurationProvider”>
<EncryptedData Type=”http://www.w3.org/2001/04/xmlenc#Element” xmlns=”http://www.w3.org/2001/04/xmlenc#”>
<EncryptionMethod Algorithm=”http://www.w3.org/2001/04/xmlenc#tripledes-cbc” />
<KeyInfo xmlns=”http://www.w3.org/2000/09/xmldsig#”>
<EncryptedKey xmlns=”http://www.w3.org/2001/04/xmlenc#”>
<EncryptionMethod Algorithm=”http://www.w3.org/2001/04/xmlenc#rsa-1_5″ />
<KeyInfo xmlns=”http://www.w3.org/2000/09/xmldsig#”>
<KeyName>Rsa Key</KeyName>
</KeyInfo>
<CipherData>
<CipherValue>WGkITVNdcbxdL8nfmPQ1xqRfUEWvFPp8mTi2KgRCUhcGG3emR0jcsy3iye8aVOLi2DWll0CaLpHJvsnghwAFrkSW8tWezZ8Fzo2kHdWNhkO2a7vbhv/F2hF2luZCfNRCdzv3azhhukUr3buvo1TORLjeFB7+sQ+NOU851b+yI +ejn9m/kzahzn87sfvTUzNoLeS7aq8ZIRFDMFa8lYh5b/mF3xDxwS1WSHUoG5oQ5EA6FNgnKo58+uOKEhpvPNv/16h8BVPHIXUAQYnoYk8EuwNBpOkVQZxlE30lTFXunfEZ/QGlIqZbkk+HaTSg0RWuIxoFnKxkb5YRfwQNRTsQDA==</CipherValue>

</CipherData>
</EncryptedKey>
</KeyInfo>
<CipherData>
<CipherValue>VatoPp7VnYHTeRodDAv8Kaj6sU9APKgSb8aov2cjaGIVLhsBzm2Nue5RFAAo1frX+ZJ2UVbFwNwa9BimsLzbBf5p1er1lMsQsuNEjc/LHQcJC0cuKqRiV6DJDUA21507qjnuWIThHiVk5cs4EtwR4ci+lbFV/j45TIoYvGonNJr2m1YtwUXRBT+nAqDRhlQnvcSCRnpbz8s6n9Nii3frz0LmuO0NHTLf3xmYB8WTLEXIawtCXJ3/hxBMS624o/LfSJorzw5HS/wya5RRArbQLJQM3TkFU5VwVZxkt5N5jw8=</CipherValue>
</CipherData>
</EncryptedData>
</connectionStrings>

When you try to access your application, the browser presented the 403 error message.

Looking the error message in the ULS logs:

image001

Error Message:

Unexpected       System.Configuration.ConfigurationErrorsException: The RSA key container could not be opened.    at System.Configuration.RsaProtectedConfigurationProvider.ThrowBetterException(Boolean keyMustExist)     at System.Configuration.RsaProtectedConfigurationProvider.GetCryptoServiceProvider(Boolean exportable, Boolean keyMustExist)     at System.Configuration.RsaProtectedConfigurationProvider.Decrypt(XmlNode encryptedNode)     at System.Configuration.ProtectedConfigurationSection.DecryptSection(String encryptedXml, ProtectedConfigurationProvider provider)     at System.Configuration.RuntimeConfigurationRecord.CallHostDecryptSection(String encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfig)     at System.Configuration.BaseConfigurationRec… 315e609c-3258-1009-4f87-732a407e2da0

The resolution:

To solve this problem, you must to adjust some permissions because the key container for the anonymous IIS machine accounts (“IUSR” group and “Server\IIS_IUSR” user) usually saved in C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA doesn’t have the correct permission by default, and the worker process identity for the anonymous user should have access to these files to be able to decrypt it or you would get this error message.

To correct, just add the “IUSR” group and “Server\IIS_IUSR” user with “write” permission in the “MachineKeys” folder like described on the screenshots below:

image

image

That’s it. Now try to access your application again, and the result will be correct!

Friday, December 13, 2013

Enabling Usage Report–SharePoint 2013

Problem:

The report “Usage” presents empty counters. To check it, go to “Site Settings“, “Popularity and Search Reports” in “Site Collection Administration” section:

Run Reports

image

Solution:

Access the SharePoint Central Administration to enable usage reports.

Obs.: Remember this report will be available in 24hrs after the first configuration.

image

image

First, confirm if the option “enabled usage data collection” is enabled and review your necessities on this section.

image

image

image

image

image

At this is point, we need to enable the responsible job for generate this datas. Access the “Review job definition” option in the “Monitoring” section:

image

Search for the job “Microsoft SharePoint Foundantion Usage Data Processing”. Note the job status is “disable” by default.

Click on the link, as presented on the image below to enable the job as your preferences.

image

This is moment we should enable job “Microsoft SharePoint Foundation Usage Data Processing” clicking on the “Enable” button.

image

image

The expected result will be:

image

With these configurations, will be possible extract usage reports from your farm / web site.

image