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!

Sunday, April 6, 2014

Simple Way to Get Office Web Apps 2013 Server Install and Configuration working

Installing Office Web Apps

Office Web Apps 2013 is a stand-alone server web application that provides capabilities to open and render a Microsoft Office Word, Excel, PowerPoint, or OneNote document as a web page.

Microsoft SharePoint 2013 can share the rendering service to display Office documents in those applications as a web page. Additionally, when accessed from within a SharePoint 2013 farm, Office Web Apps also enables rich editing features for those documents.

Note: You cannot install Office Web Apps on the same server as SharePoint 2013

Please follow the server preparation process in the following sections for the appropriate server, either Windows Server 2008 R2 or Windows Server 2012.

Windows Server 2008 R2 Preparation

Start by installing the following prerequisite software for Windows Server 2008 R2:

Open a PowerShell command running as an Administrator and execute the following commands to install the required roles and services for Office Web Apps.

Import-Module ServerManager


## Run the following command as a single line
Add-WindowsFeature Web-Server,Web-WebServer,Web-Common-Http,Web-Static-Content,Web-App-Dev,Web-Asp-Net,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Includes,Web-Security,Web-Windows-Auth,Web-Filtering,Web-Stat-Compression,Web-Dyn-Compression,Web-Mgmt-Console,Ink-Handwriting,IH-Ink-Support

Please continue with the “Office Web Apps Installation” section below.

Windows Server 2012 Preparation

To begin, open a PowerShell command running as an Administrator and execute the following commands to install the required roles and services for Office Web Apps.

Add-WindowsFeature Web-Server,Web-Mgmt-Tools,Web-Mgmt-Console,Web-WebServer,Web-Common-Http,Web-Default-Doc,Web-Static-Content,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Security,Web-Filtering,Web-Windows-Auth,Web-App-Dev,Web-Net-Ext45,Web-Asp-Net45,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Includes,InkandHandwritingServices

Download the Office Web Apps Installation

Download the Office Web Apps Server software from the Microsoft Download Center.

Office Web Apps Installation

Open and run the Office Web Apps setup.exe media to launch the setup wizard.

  1. In the Office Web Apps Server 2013 Wizard, on the Read the Microsoft Software License Terms page, select I accept the terms of this agreement and then select Continue.
  2. On the Choose a file location page, select the folder where you want the Office Web Apps Server files to be installed (for example, C:\Program Files\Microsoft Office Web Apps), and then select Install Now. Note that, if this folder does not exist, Setup will create it for you.
  3. The Choose a file location screen on the Office Web Apps install wizard.
  4. The Choose a file location screen on the Office Web Apps install wizard.
  5. When Setup finishes installing Office Web Apps Server, choose Close.

After installing the Office Web Apps 2013 server software, you are ready to install any additional add-ins and updates. You can also install any language packs your farm requires. To install the language packs, run the setup media for each of the language packs you desire.If applicable, install the latest service pack Microsoft has released for Office Web Apps 2013 and then apply the latest service packs Microsoft has released for Office Web Apps 2013 language packs.

Finally, check for updates on Microsoft Update in the server’s control panel.

     6. Restart the server.

Configuring Office Web Apps

This section describes how to configure an Office Web Apps farm and join servers to it.

Important: Low memory conditions can cause Office document previews to fail in Office Web Apps. Verify that any servers that run Office Web Apps have sufficient memory.

On the first server for the Office Web Apps farm, execute the following PowerShell command to provision the farm:

Import-Module OfficeWebApps

New-OfficeWebAppsFarm -InternalUrl "http://owa.mabotega.local" –EditingEnabled –ClipartEnabled –TranslationEnabled -Allowhttp

Confirm the Office License with “Y”:

image

The following image provides an example of the expected output from the PowerShell command.

image

PowerShell results from configuring an Office Web Apps farm

Critical: Before you can use the Office Web Apps farm, you must add your domain to the list of allowed hosts.

Run the following PowerShell command to add your domain to the list of allowed hosts, substituting your domain for “mabotega.local”

New-OfficeWebAppsHost -Domain mabotega.local

image

Restart the server

You can test the Office Web Apps configuration by navigating to this URL and verifying it displays a Web app Open Platform Interface (WOPI)-discovery XML file: https://owa.mabotega.local/hosting/discovery

image

Note: For more information on deploying and configuring Office Web Apps, please see this TechNet article: http://technet.microsoft.com/jj219455

Adding a new Server on the Office Web Apps Farm (Optional)

Once you have provisioned an Office Web Apps farm and allowed your domain, you can join additional Office Web Apps servers to the farm.

To join additional servers, install the Office Web Apps software by following the steps in the previous section and then execute the following PowerShell command:

Import-Module OfficeWebApps

New-OfficeWebAppsMachine –MachineToJoin “owa.mabotega.local”

Configuring the Windows Firewall for Office Web Apps Traffic

On each Office Web Apps 2013 Server, you will need to set a firewall rule to allow Office Web Apps inter-farm traffic and HTTP/HTTPS traffic. Alternatively, you can disable the Windows Firewall if you choose and if you have another firewall solution.

You can set the Windows Firewall rules by navigating to the Control Panel, then click System and Security, then click Windows Firewall, and finally click Advanced settings. In the Inbound Rules area, ensure that the server allows connections on port 80 (HTTP) and port 443 (HTTPS). Add the port for the Office Web Apps inter-farm communication by following these steps:

  1. In the Windows Firewall with Advanced Security window, click Inbound Rules.
  2. In the Actions panel, click New rule…
  3. In the New Inbound Rule Wizard window, select Ports as the Rule Type and click Next.
  4. Select TCP and enter “809” for the Specific local ports. Click Next.Windows Firewall Port Rule for Office Web Apps communication
  5. Windows Firewall Port Rule for Office Web Apps communication
  6. Click Next. On the Profile screen, uncheck Public and click Next.

On the Name screen, enter “Office Web Apps Inter-Farm Communication” and click Finish.

Configuring a SharePoint 2013 Farm for Office Web Apps

Logon to the SharePoint application server that hosts Central Administration and open the SharePoint 2013 Management Shell (PowerShell), running it as an administrator. Next, enter the following PowerShell command:

New-SPWOPIBinding -ServerName owa.mabotega.local -Allowhttp

image

Check the protocol used by the SharePoint in its zone (by default it is https). Next, enter the following PowerShell command:

Get-SPWOPIZone

image

We need to change the protocol used by the SharePoint in its zone to HTTP (by default it is https). Next, enter the following PowerShell command:

Set-SPWOPIZone –zone “internal-http”

Get-SPWOPIZone

image

Finally, verify that Office Web Apps is working by navigating to a SharePoint 2013 document library and verify that you can open a document as a web page.

e,g.: Excel

image

e,g.: Word

image

Note: For more information on how to configure a SharePoint 2013 farm to use Office Web Apps and for troubleshooting information, please see this TechNet article: http://technet.microsoft.com/ff431687

Reference:

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

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

Disconnect SharePoint 2013 from Office Web Apps Server

If, for any reason, you want to disconnect SharePoint 2013 from Office Web Apps Server, use the following command example:

Remove-SPWOPIBinding –All:$true

 

For now that’s it!

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)

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

Monday, February 17, 2014

Cannot start service SPAdminv4 on computer – SharePoint 2010 Administration

If you’ve experienced this error (System.InvalidOperationException, “Cannot start service SPAdminv4 on computer ‘.’) after installing/rebooting a SharePoint 2010 server and failing consistently at the SharePoint 2010 Products Configuration Wizard, then this is likely to help:

(1) Browse to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN

(2) In this directory Create a file called “WSSADMIN.EXE.CONFIG

(3) Populate it with the following:

<configuration>

      <runtime>

<generatePublisherEvidence enabled=“false”/>

      </runtime>

</configuration>

(4) Start the “SharePoint 2010 Administration” services again

Now everything should be working….

This disables checking for CAS (Code Access Security) publisher policy. MSDN article, http://msdn.microsoft.com/en-us/library/bb629393.aspx

More details, read http://blogs.msdn.com/johan/archive/2009/11/12/make-sure-you-have-an-internet-connection-when-using-signed-assemblies.aspx and http://blogs.msdn.com/dsvc/archive/2008/06/24/troubleshooting-startup-issues-with-managed-application-having-authenticode-signature.aspx

HOW TO: Como Habilitar o Developer Dashboard no SharePoint 2010

Developer Dashboard  é um novo recurso do SharePoint 2010 que vem para facilitar a vida do desenvolvedor e do responsável pelo bom desempenho e melhor experiência para o usuário final. Este recurso mostra quanto tempo uma página demorou para ser carregada e quais componentes foram carregados, sendo muito útil quando os usuários reclamam de lentidão, podendo assim, agora classificar o que seria e aonde esta “lentidão”, de forma mais fácil e rápida.

Solução:

Por default, este recurso vem desabilitado. Para habilitar, você pode utilizar o stsadm ou Windows PowerShell.

Para habilitar, usando STSADM, vá em Start > Microsoft SharePoint 2010 Products, clique em SharePoint 2010 Management Shell, e entre com o seguinte valor:

Stsadm –o setproperty –pn developer-dashboard –pv [modo]

Em [modo] , escolha a forma que você quer que ele funcione. Você pode escolher uma das três opções:

  • On – significa que o Developer Dashboard  será sempre exibido
  • Off – significa que estará desabilitado
  • Ondemand – significa que o Developer Dashboard  será exibido, mas não estará ativo, apenas quando precisar você deve ativá-lo clicando no seu ícone.

Ao habilitar este recurso, todas as páginas irão conter um ícone do Dashboard, como mostrado na imagem, porém, só os administradores do Site Collction poderão ver.

Caso tenha escolhido o modo ondemand, você pode habilitá-lo quando necessário apenas clicando sobre o ícone dele.

Figura 1: Representação do ícone

Quando habilitado, ele trará uma página com os resultados para análise.

Figura 2: Exibindo as informações

Agora basta você realizar suas análises.

Conclusão

Esta função é muito útil para os desenvolvedores para que eles possam entregar aplicações que funcionam corretamente sem ter problemas posteriores e também ajuda a detalhar o como a página e as web parts estão se comportando.

Mais referências:

http://larahvidotti.wordpress.com/2011/01/14/como-habilitar-o-developer-dashboard-no-sharepoint-2010/

Queue Service and Event Service will not start in Project Server 2007/2010

Open the registry editor

Start=>Run=>Regedit

Once the registry editor has been opened navigate to

HKLM\System\CurrentControlSet\Control

Here it will be necessary to create a new DWORD key with the following value:

ServicesPipeTimeout DWORD 60000 (decimal)

Note: 60000 = 60 Seconds.

Next, look for the WaitToKillServiceTimeout key – take note of its current value – and then change the value to 120000

Note: 120000=120 Seconds.

Reboot the Server.

Test by going to Start=>Run=>services.msc and examining the Microsoft Office ProjectServer Queue Service and Event Service. These services should now show as started, and assuming nothing else is wrong with the environment, the Queue Service should now be able to process jobs. The error messages in the event viewer should also have stopped.

Queue – ReportingProjectChangeMessageFailed (24006) – The INSERT statement conflicted with the FOREIGN KEY constraint FK_MSP_EpmAssignment_ResourceOwnerUID

Sintoma

            Ao publicar alguns projetos o job “Reporting (Project Publish)” relacionado ao projeto falha com a seguinte mensagem de erro:

“ReportingProjectChangeMessageFailed (24006) – The INSERT statement conflicted with the FOREIGN KEY constraint “FK_MSP_EpmAssignment_ResourceOwnerUID””

Causa

            Há várias causas distintas para a falha do job “Reporting (Project Publish)”. Neste caso em decorrência da mensagem de erro descrita acima a causa estava relacionada a falha de sincronização de um recurso membro do projeto com o base de dados de Reporting.

Solução

1. Executar a query abaixo na base de dados de Reporting (ProjectServer_Reporting – usar o nome conforme seu ambiente) com o intuito de identificar quais recursos tem problema de sincronização

select PubMR.Res_UID, PubMR.RES_Name, PubMR.WRES_Account, RepMER.ResourceName from ProjectServer_Reporting.dbo.MSP_Resources PubMR

left outer join ProjectServer_Reporting.dbo.MSP_EpmResource RepMER on PubMR.RES_UID = RepMER.ResourceUID where ResourceName is NULL

2. Da lista acima para o usuário que é membro do projeto forçar seu sincronismo com a base de Reporting através dos passos abaixo:

a. Acessar o PWA -> Resource Center

b. Selecionar o usuário no Resource Center e Editar

c. Salvar sem fazer qualquer alteração

d. Verificar se o seguinte job é completado com sucesso

 

3. Publicar novamente o projeto e verificar se o job “Reporting (Project Publish)” completa com sucesso.

Informações adicionais

            Conforme dito há várias outras razões que podem ocorrer a falha do job “Reporting (Project Publish)”, mas as causas dependem diretamente da descrição do erro gerado. Duas outras causas mais conhecidas do erro são:

  1. Recurso atribuido a uma tarefa do tipo “Sumarry Task”
  2. Tarefas nas Linhas de base orfãs. Como detectar este cenário e corrigir:

Please test the behavior on a test environment before.

Run the following scripts on your draft and published databases:

- First run this script to detect them:

select PROJ_NAME, MTB.PROJ_UID,TASK_UID,TB_BASE_NUM from MSP_TASK_BASELINES MTB

inner join MSP_PROJECTS MP on MTB.proj_uid=MP.proj_uid

where TASK_UID not in (select TASK_UID from MSP_TASKS)

- Next, we need to delete them:

—Script top run on the draft DB

USE ProjectServer_Draft – specify the appropriate draft database

delete from MSP_TASK_BASELINES

where TASK_UID not in (select TASK_UID from MSP_TASKS)

—Script top run on the published DB

USE ProjectServer_Published — specify the appropriate published database

delete from MSP_TASK_BASELINES

where TASK_UID not in (select TASK_UID from MSP_TASKS)

Erro ao acessar uma lista customizada do SharePoint coletando dados no Project Server 2010

Mensagem de erro:

Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.

Correlation ID:9b6b1653-baef-46a4-ace8-ff9a1f535f87

Screenshot error:

EPM2014_1

Resolução:

Aumentar o timeout nas listas:

$farm = Get-SPFarm

$farm.XsltTransformTimeOut = 10

$farm.Update()

Link de referencia: http://www.brandonclaps.com/?p=51

This was caused by the XsltTransformTimeout when using an Xslt list view. This is corrected by installing the February 2012 Cumulative Update and by making the following change via PowerShell.

Friday, February 14, 2014

Daylight saving time ended and Sharepoint still off by 1 hour

The daylight saving time ended, but SharePoint still saving all items which require a date time stamp reference with 1 hour less (in my case).

Screenshot of the behavior:

daylight1

1.Modify the Timezone.xml file to include the correct date and time for standard time and for daylight saving time. To do this, follow these steps:

a. Start Notepad, and then open the Timezone.xml file.

The Timezone.xml file is located in the following folder:

SharePoint Server 2013

Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\Config

SharePoint Server 2010

Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Config

Windows SharePoint Services 3.0 / MOSS 2007

Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Config

Microsoft Windows SharePoint Services 2.0

Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\Config

b. The contents of the Timezone.xml file should resemble the following example bellow that I will modify.

c. Locate the time zone that you want to modify. In my case was Name=”(UTC-03:00) Brasilia”

<TimeZone ID=”8″ Name=”(UTC-03:00) Brasilia” Hidden=”FALSE”>
<Bias>180</Bias>
<StandardTime>
<Bias>0</Bias>
<Date>
<Month>2</Month>
<Day>4</Day>
<Hour>23</Hour>
<Minute>59</Minute>
<Second>59</Second>
<Milliseconds>999</Milliseconds>
<DayOfWeek>6</DayOfWeek>
</Date>
</StandardTime>
<DaylightTime>
<Bias>-60</Bias>
<Date>
<Month>10</Month>
<Day>3</Day>
<Hour>23</Hour>
<Minute>59</Minute>
<Second>59</Second>
<Milliseconds>999</Milliseconds>
<DayOfWeek>6</DayOfWeek>
</Date>
</DaylightTime>
</TimeZone>

d. Modify the StandardTime element to specify the correct date and time for standard time. For the current time zone, change the Day fields from 4 to 3.

<TimeZone ID=”8″ Name=”(UTC-03:00) Brasilia” Hidden=”FALSE”>
<Bias>180</Bias>
<StandardTime>
<Bias>0</Bias>
<Date>
<Month>2</Month>
<Day>3</Day>
<Hour>23</Hour>
<Minute>59</Minute>
<Second>59</Second>
<Milliseconds>999</Milliseconds>
<DayOfWeek>6</DayOfWeek>
</Date>
</StandardTime>
<DaylightTime>
<Bias>-60</Bias>
<Date>
<Month>10</Month>
<Day>3</Day>
<Hour>23</Hour>
<Minute>59</Minute>
<Second>59</Second>
<Milliseconds>999</Milliseconds>
<DayOfWeek>6</DayOfWeek>
</Date>
</DaylightTime>
</TimeZone>

e. Click Save on the File menu to save your changes.

f. Clean the SharePoint cache using PowerShell on SharePoint 2010 or manually for other versions. Bellow the PowerShell script:

#PowerShell Script to clean SharePoint Configuration cache:

Add-PSSnapin -Name Microsoft.SharePoint.PowerShell –erroraction SilentlyContinue

Stop-Service ProjectQueueService14

Stop-Service ProjectEventService14

Stop-Service SPTimerV4

$folders = Get-ChildItem C:\ProgramData\Microsoft\SharePoint\Config
foreach ($folder in $folders)
{
$items = Get-ChildItem $folder.FullName -Recurse
foreach ($item in $items)
{
if ($item.Name.ToLower() -eq “cache.ini”)
{
$cachefolder = $folder.FullName
}

}
}

$cachefolderitems = Get-ChildItem $cachefolder -Recurse
foreach ($cachefolderitem in $cachefolderitems)
{
if ($cachefolderitem -like “*.xml”)
{
$cachefolderitem.Delete()
}

}

$a = Get-Content  $cachefolder\cache.ini
$a  = 1
Set-Content $a -Path $cachefolder\cache.ini
start-Service SPTimerV4
IISRESET

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

g. Test your environment again. Now, everything will be working right.

daylight2

Good references:

http://support.microsoft.com/kb/888253/en-us

http://spinternals.blogspot.com.br/2014/01/sharepoint-powershell-script-para.html