Monday, March 11, 2019

How to List down all SharePoint 2016 Reporting server subscriptions.


There are many scenarios that you need to list down all your existing Reporting subscription in the SharePoint.

Sometimes , you might find your reporting server subscription is not showing the in the manage subscription menu.

There is a reason for it. Currently subscriptions  are saved based on URL (Alternative access URL) and User. So if your farm has different AAMs, even though you are a same user , it will not show under your subscriptions.

So how you can get it.

There is a no direct function to get this unless you are using SSRS API to query the data.

but you can find these entries by simply querying SSRS SharePoint database. 

SELECT   *
   FROM [ReportingService_ServiceApplication_DB].[dbo].[Subscriptions] with(nolock)

You can find below details

[SubscriptionID]
,[OwnerID]
,[Report_OID]
,[Locale]
,[InactiveFlags]
,[ExtensionSettings]
,[ModifiedByID]
,[ModifiedDate]
,[Description]
,[LastStatus]
,[EventType]
,[MatchData]
,[LastRunTime]
,[Parameters]
,[DataSettings]
,[DeliveryExtension]
,[Version]
,[ReportZone]


You will see a output like below

Here you can find the owner , subscription URL and other relevant information

Wednesday, March 6, 2019

The content database has a schema version which is not supported this version

How to copy you production SharePoint  database to development environment.

I had my production environment as

  • SharePoint 2013
  • SQL Server 2012

and I want to move the instance to another environment , which is freshly installed and different environment and different KBs

  • Share Point 2013
  • SQL Server 2016

How to migrate SharePoint 2013 , SQL Server 2012 Content Database to SharePoint 2013 SQL Server 2016.

Method 1.

This is a general method, which is used for upgrading your content database.

1 . Get the back up of the current Content Database

2. Copy SQL backup to new environment

3. Restore the SQL Back Up in to the new environment

4. Go to the Security Login section and grant permission to content database for existing SharePoint Users.

 

5. You need to select the User mapping and DBO for the content database.

6 Then, execute below PS in SharePoint PowerShell. Make sure you executed as Run as Administrator


7 Firstly, You need to Update the content database.

8. then, mount the using the command line.

Mount-SPContentDatabase -name "WSS_Content "  -WebApplication http://stgwfe01/ -confirm:$false


Method 2.

I would recommend this  method for only development environment. If any production updates you should follow the proper method which is mentioned in the method 1.

Firstly run below code against your production content database , and find out the version number.

/****** Script for SelectTopNRows command from SSMS  ******/
SELECT TOP (1000) [VersionId]
       ,[Version]
       ,[Id]
       ,[UserName]
       ,[TimeStamp]
       ,[FinalizeTimeStamp]
       ,[Mode]
       ,[ModeStack]
       ,[Updates]
       ,[Notes]
   FROM [Content_Portal].[dbo].[Versions]

and you will be get something like this.


then take the version numbers and update the content database table in the development environment before attaching the database ( You need to skip the point 7)

update [WSS_Content].[dbo].[Versions] SET [Version] = '15.0.138.0'
where [Id] =2

you need to repeat the update for all IDs including 1 , 2 and 3. I you have  more that that you can delete those entries in the table.

 

Thursday, February 14, 2019

Complete guide to Install SharePoint in a Three Server Farm using AutpSPInstaller


This article will be divided to three sections

  • Setting up the Environment and Service Accounts
  • Getting Ready with AutoSPInstaller Online
  • Configuring the XML using Online Editor and Installation


Setting up the Environment and Service Accounts

AutoSPInstaller Online is one of a great project that facilitate Automated SharePoint installation including Sharepoint 2010, 2013 and 2016.

Auto SP Installer provides a powerful way to deploy and configure a single-server development environment to multiple-server SharePoint farm.
Reference: https://autospinstaller.com/

Before doing anything we will set up the environment for SharePoint three server Farm.

Will name these servers as
SPWFE - Share Point Front End Server
SPAPP - Share Point App server
SPDB - DB server

Please find the reference for SharePoint minimum requirement and practices from

https://docs.microsoft.com/en-us/SharePoint/install/install-sharepoint-server-2016-across-multiple-servers

For the the medium segregation, we have to create below list of service accounts.

Service Accounts for Active Directory

Service Account name : spadmin
Rights : Local Admin All Servers (DB,WFE,APP)
SQL DB Rights: SQL DB Creator and Security Admin Rights
Domain Privileges: Service User
Description: Use for set up and Configuration  

Service Account name : spfarm
Domain Privileges: Service User
Description: sp timer service , Central Admin Application Pool, Other Configurations

Service Account name : spservices
Domain Privileges: Service User
Description:Service and Pool account user  

Service Account name : spsqlservice
Domain Privileges: Service User
Description:Run services in SQL Server (MSSQLSERVER, SQLSERVERAGENT)

Service Account name : spsearch
Domain Privileges: Service User
Description: SP search service , crawlers , search related  

Service Account name : spprofile
Domain Privileges: Need Replicating Directory Changes
Description:user profile synchronization account  

User Profile User Configuration

Run dsa.msc in Run Windows or open Active Directory Users and Computers.

Then Right click the domain and click delegate control.

Then click next and select spprofile user.

Then Click next and Select Custom Task Delegate and click next.

Then select This folder, Existing objects in this folder, and creation of new objects in this folder and click next.

In here select Replicating Directory Changes and Proceed to  finish the wizard.

Configure SQL server

After installing SQL server you need to do following configuration. also you might need to install .NET 3.5 manually in the server by specifying source path manually.

Setting Up  DB Server (Login as spadmin)

I installed Windows Server 2012 in the DB server. After installing OS you need to install the SQL server. Following are the steps you need to perform additionally.

In the feature selection you can select Database Services and Management Tools – Basic , Management Tools – Complete , Other than these features you can select other related ones if needed.

Then You can add spadmin as a Admistrator for management.

And you should add  spsqlservice as service accounts running credentials for  MSSQLSERVER, SQLSERVERAGENT.

Then complete the installation and Enable TCP/IP , and start the SQL browser in SQL configuration management.

Getting Ready with AutoSPInstaller Online

First, download the latest build from below link
https://autospinstaller.com/Download

and  copy, SP folder to C:\ drive (this can be any convenient location)

Now you need to mount your SharePoint Image and copy all the content to inside the folder

2016 –> SharePoint

then download the prerequisites files from as required

SQL Microsoft SQL Server 2012 Native Client:
http//www.microsoft.com/en-us/download/details.aspx?id=29065
Microsoft ODBC Driver 11 for SQL Server:
http//www.microsoft.com/en-us/download/details.aspx?id=36434
Microsoft Sync Framework Runtime v1.0 SP1 (x64):
http//www.microsoft.com/en-us/download/details.aspx?id=17616
Windows Server AppFabric 1.1:
http//www.microsoft.com/en-us/download/details.aspx?id=27115
Microsoft AppFabric 1.1 for Windows Server (KB2671763):
http//support.microsoft.com/en-us/kb/2671763
Microsoft Identity Extensions:
http//go.microsoft.com/fwlink/?LinkID=252368
Microsoft Information Protection and Control Client:
http//go.microsoft.com/fwlink/?LinkID=528177
Microsoft WCF Data Services 5.0:
http//www.microsoft.com/en-us/download/details.aspx?id=29306
Microsoft WCF Data Services 5.6:
https//www.microsoft.com/en-us/download/details.aspx?id=39373
Microsoft .NET Framework 4.5.2:
http//support.microsoft.com/en-us/kb/2934520
Microsoft .NET Framework to disable RC4 in Transport Layer Security (KB2898850):
http//www.microsoft.com/en-us/download/details.aspx?id=42883
Visual C++ Redistributable Package for Visual Studio 2013:
http//www.microsoft.com/en-us/download/details.aspx?id=40784

and copy under the prerequisites folder  inside the SharePoint 2016.

Server Set UP Servers

You need to install following pre software in Servers in order to Set Up SharePoint.

Application server Server, Web Front End Server

OS: Windows Server 2016

You might need to install l .NET Framework 3.5 to the server.
Thus you need to install manually.

Ref: http://www.danielclasson.com/install-net-framework-35-server-2012/ Jump
http://en.community.dell.com/techcenter/os-applications/w/wiki/4146.installing-net-3-5-framework-on-microsoft-windows-server-2012.aspx Jump

DB Server

OS : Windows Server 2016
SQL Server 2017

After you install the basic required Software and Operating system now you are ready for install the SharePoint.

Before, installing the SharePoint you must configure the AutoSPinstallerInput file.

This is just a XML file , you can Edit using NotePad ++, but there is a great online tool provided by AutoSPInstaller Online, that you can use to configure the XML file.

https://autospinstaller.com/FarmConfiguration

You can load the XML and enter your service account details and DB connection details and save the file for installation.


Configuring the XML using Online Editor and Installation

after you have set up everything, as per my previous articles, You need to go to Online Configuration Editor

https://autospinstaller.com/FarmConfiguration

Then you need to choose Load from my XML and and choose the AutoSPInstallerInput file.

Then the below page will be visible.

we don't need to edit all the configurations for this scenario.

First add the HOST name for the SharePoint Server. Since we have two SharePoint servers, we will insert both two hostnames.

If you are multiple domain environment, use the full domain name for the host.

Then navigate to Install Section and Specify the SharePoint Product Key and the Version to 2016 if it if not selected.

then, Navigate to Main section,

here, there are few sections you need to fill up.

First you need to add the Security Phase for the Farm

Then we have to mention the farm account name, refer my first Article.

Service Account name : spadmin
Rights : Local Admin All Servers (DB,WFE,APP)
SQL DB Rights: SQL DB Creator and Security Admin Rights
Domain Privileges: Service User
Description: Use for set up and Configuration

since we are not using any custom alias , remove the tick and mention the database server name and the prefix for SharePoint databases.

Central Administration will be provision on the APP server, thus I selected it and remove the  SSL because , we will be running behind the WAF

Then specify the other accounts which we have created before as below

Service Account name : spfarm
Domain Privileges: Service User

Service Account name : spservices
Domain Privileges: Service User

Service Account name : spsearch
Domain Privileges: Service User

Service Account name : spprofile
Domain Privileges: Need Replicating Directory Changes

Then navigate to services section and select web application to deploy in WFE server.

Then configure the email , setting, You can use the existing Email server.

All other sections are optional to configure.

go to the Review and Download section to copy the configuration file.

Copy and paste the XML file to AutoSPInstallerInput file.

Now you are done with the configuration.

Just go to Automation Folder

and Launch to install the SharePoint.

and do the same installation in SPApp server as well.

Tuesday, February 12, 2019

Microsoft.Data.Entity.Design.VersioningFacade.ReverseEngineerDb.SchemaDiscovery.

I have come across this error while I'm generating SharePoint Business Object using Entity Framework.


Error

Microsoft.Data.Entity.Design.VersioningFacade.ReverseEngineerDb.SchemaDiscovery.EntityStoreSchemaGeneratorDatabaseSchemaLoader.CreateFilteredCommand(String sql, String orderByClause, EntityStoreSchemaFilterObjectTypes queryTypes, List`1 filters, String[] filterAliases)


This happed when I change the Framework for match new Visual Studio environment.

Solution.

There were lots of suggestions, however , below method worked for me.

First, we need to open the visual studio command prompt.

because, gacutil will not work in normal command prompt , unless you specified the path.

then you can execute the below gacutil command to remove the wrong EntityFramework version.

gacutil /u EntityFramework