Advertisements

Configure diagnostic logging SharePoint 2016

The SharePoint Server 2016 environment might require configuration of the diagnostic logging settings after initial deployment, after upgrade, and if a change is made to the environment, such as adding or removing a server.

The guidelines in the following list can help you form best practices for the specific environment.

* Change the drive to which the server writes logs:

By default, SharePoint Server 2016 writes diagnostic logs to the same drive and partition on which it was installed. Because diagnostic logging can use a large amount of drive space and compromise drive performance, you should configure SharePoint Server 2016 to write to another drive on which SharePoint Server 2016 is not installed.

You should also consider the connection speed to the drive on which SharePoint Server 2016 writes the logs. If verbose-level logging is configured, the server records a large amount of data. Therefore, a slow connection might result in poor log performance.

* Restrict log disk space usage:

By default, the amount of disk space that diagnostic logging can use is unlimited. Therefore, restrict the disk space that logging uses, especially if you configure logging to write verbose-level events. When the disk reaches the restriction, SharePoint Server 2016 removes the oldest logs before it records new logging data.

* Use the Verbose setting sparingly:

You can configure diagnostic logging to record verbose-level events. This means that SharePoint Server 2016 records every action that it takes. Verbose-level logging can quickly use drive space and affect drive and server performance. You can use verbose-level logging to record more detail when you are making critical changes and then reconfigure logging to record only higher-level events after you make the change.

* Regularly back up logs:

Diagnostic logs contain important data. Therefore, back up the logs regularly to ensure that this data is preserved. When you restrict log drive space usage, or if you keep logs for only a few days, SharePoint Server 2016 automatically deletes log files, starting with the oldest files first, when the threshold is met.

* Enable event log flooding protection:

When you enable this setting, SharePoint Server 2016 detects repeating events in the Windows event log, and suppresses them until conditions return to a typical state.

You can set the level of diagnostic logging for the event log and for the trace log. This limits the types and amount of information that are written to each log.

The following tables define the levels of logging that are available for the event log and trace log.

event-log-levels

trace-log-levels

Configure diagnostic logging by using Central Administration :

  1. In Central Administration, on the home page, click Monitoring.
  2. On the Monitoring page, in the Reporting section, click Configure diagnostic logging.
  3. On the Diagnostic Logging page, in the Event Throttling section, configure event throttling as follows:To configure event throttling for all categories:
    1. Select the All Categories check box.
    2. Select the event log level from the Least critical event to report to the event log list.
    3. Select the trace log level from the Least critical event to report to the trace log list.

    To configure event throttling for one or more categories:

    1. Select the check boxes of the categories that you want.
    2. Select the event log level from the Least critical event to report to the event log list.
    3. Select the trace log level from the Least critical event to report to the trace log list.

    To configure event throttling for one or more subcategories (you can expand one or more categories and select any subcategory):

    1. Click the plus (+) next to the category to expand the category.
    2. Select the check box of the subcategory.
    3. Select the event log level from the Least critical event to report to the event log list.
    4. Select the trace log level from the Least critical event to report to the trace log list.

    To return event throttling for all categories to default settings:

    1. Select the All Categories check box.
    2. Select Reset to default from the Least critical event to report to the event log list.
    3. Select Reset to default from the Least critical event to report to the trace log list.
  4. In the Event Log Flood Protection section, select the Enable Event Log Flood Protection check box.
  5. In the Trace Log section, in the Path box, type the path of the folder to which you want logs to be written.
  6. In the Number of days to store log files box, type the number of days (1-366) that you want logs to be kept. After this time, logs will automatically be deleted.
  7. To restrict the disk space that logs can use, select the Restrict Trace Log disk space usage check box, and then type the number gigabytes (GB) you want to restrict log files to. When logs reach this value, older logs will automatically be deleted.
  8. After you have made the changes that you want on the Diagnostic Logging page, click OK.

Configure diagnostic logging 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 Server 2016 cmdlets.

  1. On the Start menu, click All Programs.
  2. Click SharePoint 2016.
  3. Click SharePoint 2016 Management Shell.
  4. To change the drive to which the server writes logs, at the Windows PowerShell command prompt, type the following command:

Set-SPDiagnosticConfig -LogLocation D:\DiagnosticLogs

  1. To restrict log disk space usage, at the Windows PowerShell command prompt, type the following command:

Set-SPDiagnosticConfig -LogMaxDiskSpaceUsageEnabled

Or assign the maximum disk space for logs:

Set-SPDiagnosticConfig -LogDiskSpaceUsageGB 500

  1. To view the current logging level, at the Windows PowerShell command prompt, type the following command:

Get-SPLogLevel

  1. To change the logging level, at the Windows PowerShell command prompt, type the following command:

Set-SPLogLevel -TraceSeverity Monitorable

To set all categories back to default levels, at the Windows PowerShell command prompt, type the following command, and then press ENTER:

Clear-SPLogLevel

9. To enable event log flooding protection, at the Windows PowerShell command prompt, type the following command:

Set-SPDiagnosticConfig -EventLogFloodProtectionEnabled

Advertisements

Windows Server Appfabric: Installation error SharePoint 2016

If you are installing SharePoint 2016 Prerequisites manually downloading the files and after that run the “Install Software Prerequisites” from SharePoint 2016 installation file to verify everything installed manually is correct, you may face error like this

“Windows Server Appfabric: Installation error“.

sp2016

This is a generic MSI error message and does not give any indication about how to get the issue fixed. Uninstall or reinstalling only makes it worse.

Resolution :

The reason being the prerequisites installs the file and configure it automatically. If we install manually, then we are trying to bypass the configuration, so that error will be received.

The issue can be caused due to the following:

  •  The path to the PowerShell executable that is needed for the AppFabric installation is incorrect.
  •  In some scenarios, repeated uninstallation and re-installation does not fix the issue. This is because the installer does not remove the PSModulePath entry in Environment

  •  Variables during uninstallation and the installation fails because the entry already exists.
    If you are trying to install all the prerequisites manually as the server does not have a connection to internet.

Note:

Appfabric installation and configuration has to be done by the prerequisite installer ONLY and not in a stand-alone manner.You should follow the manual process of installation  if there is error in automatic process by following Install Prerequisite (prerequisiteinstaller.exe) .

You can implement any one of the two solutions listed below

Solution 1

Append the following path to PSModulePath entry in the environment variables – %SYSTEMROOT%\System32\WindowsPowerShell\v1.0

  • Go to My Computer, right-click Properties
  • On the System page click Advanced System Settings on the left-side pane.
  • If you receive a UAC prompt, click on Yes to launch the System Properties dialog box
  • From the Advanced tab, click Environment Variables
  • Within the System Variables section in the lower half, select PSModulePath and click on Edit (or double-click PSModulePath‘)
  • Append the following path to PSModulePath entry in the environment variables
    %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
  • Ensure that the PSModulePath entry looks like this:
    C:\Windows\system32\WindowsPowerShell\v1.0\Modules\;c:\Program Files\AppFabric 1.1 for Windows Server\PowershellModules

Solution 2

  • There are chances that other applications might be referencing the same variable and may fail if it is deleted. This is what we can do if solution 1 does not help.
  • Remove the PSModulePath entry from the ‘Environment Variables’ and re-run the installer. Once it completes successfully, ensure that the PSModulePath entry looks the same as mentioned in solution 1.

Reference :

https://msdn.microsoft.com/en-us/library/dd878326(v=vs.85).aspx

Cannot connect to database master at SQL Server at server_name. The database might not exist, or the current user does not have permission to connect to it Error SharePoint 2016

Cannot connect to database master at SQL Server at server_name. The database might not exist, or the current user does not have permission to connect to

Error:

“Cannot connect to database master at SQL Server at server_name. The database might not exist, or the current user does not have permission to connect to it” 

cannot-connect-to-database-master-at-server_sharepoint2016

Solution:

Open the Windows Firewall with Advanced Services and add an inbound rule to allow traffic over port 1433.

amazon   amazonsp2016  amazonsp2016_2

Failed to create configuration database exception SharePoint 2016

Error :

There was an error while running Install Prerequisite (prerequisiteinstaller.exe)  “Failed to create configuration database. An exception of type Microsoft.SharePoint.Upgrade.SPUpgradeException was thrown. Additional exception information: One or more types failed to load. Please refer to the upgrade log for more details.

psconfigsharepoint2016

Solution:

you may face this issue while installing manually instead of using the prerequisiteinstaller.exe

Uninstall WcfDataServices and then reinstalling the WcfDataServices using the prequisiteinstaller.exe automatically or using command with the appropriate parameter.

prerequisiteinstaller.exe /wcfdataservices56: WcfDataServices.exe location

Then delete two databases from SQL Server which are created by previous psconfiguration and run Products Configuration Wizard again, it will be successful.

amazon  amazonsp2016  amazonsp2016_2

Program can’t start because api-ms-win-crt-heap-l1-1-0.dll is missing SharePoint2016

This program can’t start because api-ms-win-crt-heap-l1-1-0.dll is missing from your computer.” error while running SharePoint Products Configuration Wizard.

api-ms-win-crt-heap-l1-1-0

*Missing update patches “Windows 10 Universal Runtime update” for Windows Server 2012 R2.

  • Installation of Windows Server 2012 R2 patch KB299926 is required so as to resolve this issue.

But  “The update is not applicable to your computer.” error came after that as below.

kb2919355

This is because Windows 10 Universal C Runtime KB2999226 is dependent on a Windows Server 2012 R2 Cumulative Update package in KB2919355.

Check windows updates, install patch KB2919355 and “The update is not applicable to your computer.”error will be resolved and after which there will be no error in installation of  the Windows 10 Universal C Runtime.

Have a look into my previous post Install Prerequisite (prerequisiteinstaller.exe) SharePoint 2016.

Unable to install Microsoft Information Protection and control Client 2.1 error SharePoint 2016

Unable to install Microsoft Information Protection and control Client 2.1 error SharePoint 2016

Hi Everyone.

The waiting came to an end and started working with the most recent version of SharePoint.It’s very exciting to work with newer version SharePoint 2016 .

We started with the installation of SharePoint 2016 and faced one issue in the first step .

When I run the Install Prerequisite (prerequisiteinstaller.exe), the “There was an error during installation.Unable to install Microsoft Information Protection and control Client 2.1” error appears as below.

Unable to install Microsoft Information Protection and control Client Error SharePoint 2016

This means that there is error in downloading automatically and this needs to be downloaded and installed manually.

You can click on the links to download directly.

Application Server Role, Web Server (IIS) Role
Microsoft SQL Server 2012 SP1 Native Client
Microsoft ODBC Driver 11 for SQL Server
Microsoft Sync Framework Runtime v1.0 SP1 (x64)
Windows Server AppFabric 1.1
Windows Identity Foundation (KB974405)
Microsoft Information Protection and Control Client 2.1
Microsoft WCF Data Services 5.6
Microsoft .NET Framework 4.6
Cumulative Update Package 7 for Microsoft AppFabric 1.1 for Windows Server (KB 3092423)
Visual C++ Redistributable Package for Visual Studio 2012
Visual C++ Redistributable Package for Visual Studio 2015

Install all above prerequisites manually  which shown installation error and run the install Prerequisite again, it shows Install Completely.

This SQLServer instance does not have the required “max degree of parallelism” setting of 1

I have got this error while trying to install SharePoint 2013

max degree of parallelism

What is Max Degree of Parallelism ?
When an instance of SQL Server runs on a computer that has more than one microprocessor or CPU, it detects the best degree of parallelism, that is, the number of processors employed to run a single statement, for each parallel plan execution. You can use the max degree of parallelism option to limit the number of processors to use in parallel plan execution. SQL Server considers parallel execution plans for queries, index data definition language (DDL) operations, and static and keyset-driven cursor population.
Read this for more details
http://technet.microsoft.com/en-us/library/ms189094.aspx

How to fix it ?

  1. Open Microsoft SQL Server Management Studio
  2. Login with sysadmin user
  3. Right Click on instance name and select properties >> Advanced
  4. Change Max Degree of Parallelism to 1
  5. Restart the SQL Service

Installing Workflow Manager Offline

Microsoft has introduced new Workflow engine and concept with SharePoint 2013 called Workflow Manager.

The SharePoint 2013 Workflow platform uses the new Workflow Manager service. Workflow Manager is built on top of Windows Workflow Foundation. Windows Workflow Foundation is part of the .NET Framework 4.5.

Workflow Manager is a separate download and must be configured to communicate with the SharePoint Server 2013 farm.

In several cases your environment is secured and not accessing the internet and you want to install the workflow manager so in the following steps I am going to explain how to do that so you can install Workflow Manager offline to server(s) not connected to the internet.

  • Download the web platform installer

http://download.microsoft.com/download/C/F/F/CFF3A0B8-99D4-41A2-AE1A-496C08BEB904/WebPlatformInstaller_amd64_en-US.msi and install it on a machine with internet access

  • Run the following commands as administrator from command prompt on the machine with internet access to download Service Bus, Workflow Client and Workflow Manager Refresh for offline

Webpicmd /offline /Products:ServiceBus /Path:E:ServiceBus

Webpicmd /offline /Products:WorkflowClient /Path:E:WorkflowClient

Webpicmd /offline /Products:WorkflowManagerRefresh /Path:E:WorkflowManagerRefresh

 

Note: modify E: with the path you would like to download to

  • On the machine with internet access, download the Cumulative Update for Service Bus 1.0 from:

http://www.microsoft.com/en-us/download/details.aspx?id=36794

  • Copy the downloaded file from Step 1, 2 and 3 to the server(s) where you will install the Workflow Manager.
  • On each server where you will install workflow manager run and install the following
  • Open command prompt as administrator and run the following:

WebpiCmd.exe /Install /Products:ServiceBus /XML:E:ServiceBusfeedslatestwebproductlist.xml

  • Manually install the file you downloaded from step 3
  • Open command prompt as administrator and run the following:

WebpiCmd.exe /Install /Products:WorkflowClient /XML:E:WorkflowClientfeedslatestwebproductlist.xml

  • Open command prompt as administrator and run the following:

WebpiCmd.exe /Install /Products:WorkflowManagerRefresh /XML:E:WorkflowManagerRefreshfeedslatestwebproductlist.xml

Note: modify E: with the path where files you copied from previous steps exist.

The next step is to configure the Workflow Manager Farm and connect it with SharePoint to do so check the following article from MSDN

https://msdn.microsoft.com/en-us/library/jj193510(v=azure.10).aspx

SharePoint 2010 – The 14 Hive and other important directories

The 14 Hive – Folder Location
The 14 Hive folder is located at the following path
C:Program FilesCommon filesMicrosoft SharedWeb Server Extensions14

14hive

The 14 Hive – Folder Structure
The 14 Hive has a definite folder structure which holds the core SharePoint server files.

  • ADMISAPI:- It contains soap services for Central Administration. If this directory is altered, remote site creation and other methods exposed in the service will not function correctly.
  • Bin:- The directory contains all the core binary files, utilities which used by SharePoint Services.  command line tools such as STSADM.EXE also present in this folder.
  • Config:- This directory contains files used to extend IIS Web sites with SharePoint Server. If this directory or its contents are altered, Web application will not function correctly.
  • HCCab:- This directory has a set of cab files which has content information used by the SharePoint help system.
  • Help:- The folder contains html help file (.chm) used by the configuration wizard.
  • ISAPI:- This directory contains all the standard Web Services for SharePoint and resources and configuration files that the web services use.
  • Logs:- This is the folder where we can have all the SharePoint related logs will see. This is important when any problem or error occur in SharePoint you have to trace the logs files in this folder to get the error messages.
  • Resources:- This directory contains the core.resx file used for creating language packs for SharePoint.   by which different SharePoint sites with different languages and cultures can be create.
  • Template:- It contains the core web site functionality like the features, templates, configurations, resources of a web site.
  • UserCode:- This directory contains files used to support sandbox solution.
  • Web Clients:- This directory contains files related to Client Object Model.
  • Web Services:- This directory is the root directory where SharePoint back-end Web services are hosted, for example, Excel and Search.


Other Important SharePoint 2010 Directories
1) C:Inetpubwwwrootwss – This directory (or the corresponding directory under the Inetpub root on the server) is used as the default location for IIS Web sites.
2) C:ProgramFilesMicrosoft Office Servers14.0 – This directory is the installation location for SharePoint Server 2010 binaries and data. The directory can be changed during installation.
3) C:ProgramFilesMicrosoft Office Servers14.0WebServices – This directory is the root directory where SharePoint back-end Web services are hosted, for example, Excel and Search.
4) C:ProgramFilesMicrosoft Office Servers14.0Data – This directory is the root location where local data is stored, including search indexes.
5) C:ProgramFilesMicrosoft Office Servers14.0Logs – This directory is the location where the run-time diagnostic logging is generated.

“The license state for the current server doesn’t match the farm’s license state”– SharePoint PSConfig Error

Recently I have involved in an interesting troubleshooting issue. There are many blog posts and TechNet discussions about this error. Thought that to post it here about my experience.

Here is the scenario. Customer has two Windows 2008 R2 Std machines (lets call it as srvsp1 & srvsp2) installed and configured with the following products.

  1. SharePoint Server 2010 Enterprise Edition
  2. Office Web Apps

Recently we have patched those two servers , for some troubleshooting one of the servers (srvsp2) was disconnected from the farm. After completing the installation while trying to add the server back to the farm by running the PSConfig we got the below error,

The license state for the current server doesn’t match the farm’s license state.
System.InvalidOperationException: The current server cannot be joined to this farm because the set of installed products does not match the products installed in the farm.

The license state for the current server doesn’t match the farm’s license state.
at Microsoft.SharePoint.Administration.SPFarm.Join()
at Microsoft.SharePoint.PostSetupConfiguration.ConfigurationDatabaseTask.CreateOrConnectConfigDb()
at Microsoft.SharePoint.PostSetupConfiguration.ConfigurationDatabaseTask.Run()
at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()

Here are the troubleshooting steps.

# Step 1

Verify the configuration database has correct entries of all installed products. For that , we ran the following query against the “Objects” table of SharePoint configuration database.

Select * from Objects with (nolock) where properties like ‘%icrosoft.SharePoint.Administration.SPInstallState%’

From the result copy the “Properties” column value to notepad or any xml editor tool, in my case I have used Visual Studio.

2577.image_3AD92119

Values that we are interested the ones highlighted in the below screenshot. Same is given below.

beed1f75-c398-4447-aef1-e66e1f0df91e
d5595f62-449b-4061-b0b2-0cbad410bb51

4774.image_1834E29E

# Step 2

Once we get those GUIDs, next step is make sure that any difference in the actual Physical SharePoint server’s installed products and configuration database.

To do that, check the below registry location in both the SharePoint Servers (srvsp1 & srvsp2).

HKEY_LOCAL_MACHINESOFTWAREMicrosoftShared ToolsWeb Server Extensions14.0WSSInstalledProducts

6837.image_75FCD717

{90140000-1014-0000-1000-0000000FF1CE} REG_SZ BEED1F75-C398-4447-AEF1-E66E1F0DF91E
{90140000-110D-0000-1000-0000000FF1CE} REG_SZ D5595F62-449B-4061-B0B2-0CBAD410BB51
{90140000-112D-0000-1000-0000000FF1CE} REG_SZ 926E4E17-087B-47D1-8BD7-91A394BC6196

Here we can clearly see that the physical box has 3 entries whereas the configuration database has only 2 of them.

More details of the GUIDs are given below.

BEED1F75-C398-4447-AEF1-E66E1F0DF91E is for “SharePoint Foundation 2010”,

D5595F62-449B-4061-B0B2-0CBAD410BB51 is for “SharePoint Server 2010 Enterprise”

926E4E17-087B-47D1-8BD7-91A394BC6196 is for “Office Web Companions 2010″ (Office Web Apps)

(Just FYI, for more information all different product SKUs and it’s GUIDs please refer this article http://msdn.microsoft.com/en-us/library/ff721969.aspx )

In our case, the Configuration database should have had 3 entries to match the registry in a normal farm. For some reason it was not updated with the office web apps production installation , it may caused by an installation issue.

Resolution:

Run the following Power Shell commandlet on any working server in the farm. In our case it was srvsp1, the reason we would need to run from this server is because the problem server – srvsp2 is still not in the farm.

Set-SPFarmConfig –InstalledProductsRefresh

This will pick the entries from the server and reset the entries in the Config DB. 

To double-check, you can run the same SQL query mentioned above and confirm the values.

Hope this will helpful while troubleshooting this specific issue related to SharePoint. There are different scenarios as well, eg: configuration database may have the values but it was not there in the physical server’s registry. To fix that you may end up with uninstall and install the product to update it correctly.