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

Monday, 14 January 2019

Blocking Anonymous Users from Sharepoint List Pages

All public facing Sharepoint sites and Sharepoint intranet in some instance are configured to allow anonymous access. If anonymous users have read/write access to lists they will be able to see the Sharepoint list pages such as AllItems.aspx, Dispform.aspx, Editform.aspx, and Newform.aspx by using a URL.

Since this is not a desirable situation, anonymous users should be blocked from seeing the list pages. This can be achieved by changing the ASP.Net configuration settings for the Sharepoint site.  Following lines have to be added to the web.config file of the Sharepoint site.

<location path="lists">
   <system.web>
     <authorization>
       <deny users="?" />
     </authorization>
   </system.web>
 </location>

This will prevent the anonymous users from accessing any pages under Lists. If they try to navigate to a list page such as http://server/lists/listname/allitems.aspx they will be prompted for username and password.

Monday, 17 December 2018

[Fixed] Restore-SPSite : the extension microsoft.office.project.server.database.extension.projectdatabaseextension is of version xx.xx.xx.xx, and the backup was on version xx.xx.xx.xx. these versions are incompatible.

Sometimes we have to restore the site backup to another SharePoint server, but this is possible that source site backup has an older version than the target version.
Still, if we perform Restore-SPSite command for restoration than it gives below error due to these versions are incompatible.

Restore-SPSite : the extension microsoft.office.project.server.database.extension.projectdatabaseextension is of version xx.xx.xx.xx, and the backup was on version xx.xx.xx.xx. these versions are incompatible.



To fix this error ideally you should same Major and Minor server version of the source and the target server, but this is very rarely seen that both have the same minor versions. to fix this I am mentioning one trick that will fix this issue, BUT this is not a proper way to restore or There is no guarantee that it will work in your particular case.

  1. First, download the HxD hexeditor tool from here
  2. Open your .bak file using this tool
  3. Search for SharePoint version, in my case I looked for the minor version which is 16.1.273.0 and update it with the new version 16.1.307.0 so basically, I am restoring the lower SP version to higher SP version.
  4. Keep in mind you might get permission while writing/updating the .bak file using the tool, in that case, you have to give write permission to the system user to the backup folder.











Once you save the file after the change then you have to again run the Restore-SPSite command and this time it will successfully run and backup will restore to the new site collection.

Hope this trick will help someone. But remember that it is hack and use it carefully.  

Sunday, 16 December 2018

Migrating existing SharePoint server SQL to another SQL server

Recently I did the SQL server migration for my SharePoint 2010 machine.
My task is to migrate the existing SharePoint 2010 SQL which was pointing to SQL Server 2008 to SQL Server 2016.

For that I followed below steps:
  1. Took the SharePoint web applications database backup from SQL server 2008. (You can verify the attached DB from Central admin → Manage content database)
  2.  Attached those DB to the new SQL server 2016.
  3. Added the Admin User to the security group using SQL server 2016 management studio.
  4. Provided admin user following permission from Server roles section db_backupoperator db_owner 
  5. In my case I have to migrate the complete SharePoint to a new SQL server, for that, I have to create Central Admin as well, but you cannot migrate CA DB, you have to re-configure it using SharePoint product configuration wizard on the source server.
  6. Before doing this I took the screenshot for AAM settings and extract all WSPs files from CA (source server) using PowerShell, also took managed metadata service applications backups, other services like search, User profile etc, I created using configuration wizard and manually configure them from CA.
  7. Now I configured the CA (in source server) by disconnecting it from existing SQL server and choose "create new server farm", then I provided target SQL 2016 server details like database name, admin credentials, phrase (kind of password), CA port etc. once all required information provided, wizard starts configuring CA on source machine. after that, I configured a few services.
  8. Once CA is ready, I started creating web applications and dismount/mount the DB backups to it using PowerShell, for that first I have to dismount is newly created DB using below cmd: Dismount-spcontentdatabase "newly_created_webapp_db_name"
  9. Then mounted the old db which I already attached to the new SQL 2016 server (step-2) using below cmd: stsadm -o addcontentdb -url "http://newly-created-webapp-url" -databasename WSS_Content_old_db -databaseserver SQL2016SERVERNAM
After all this I was able to see from CA → Manage content database section that this site is connected to new SQL server, now its time to browse it. and it seems working fine. UI is good except some functionality which is related to services and web parts WSPs.
So make them functional again, I have to configure the MMS service which is responsible for my top navigation and again deployed the WSPs, once I did all these deployments and changes, the website works like a charm.

Now final work that I did is to configure the AAM settings for SP site from CA so that it can be accessed thru outside.


Wednesday, 12 December 2018

[Fixed] Sharepoint 2016 prerequisites fails - Download error

Users mostly facing issue while running Sharepoint 2016 prerequisites installer is - "Download error".

I also faced this issue while running the prerequisites setup, so that I manually download and install those components but this is not the solution. if you install prerequisites manually then there are 80% chances that your SharePoint is not configured properly using SharePoint product configuration wizard. I will point out those issues as well in my later post.

Let me come to the point, what error looks like:

now, HOW TO FIX THAT 

The problem is IE is set to not download files and also IE enhanced security is ON.

So before running the prerequisite installer, go into IE/Internet Options/Security/Custom Level and enable file downloads. However, this isn't enough.
Also, need to go into server manager and disable IE Enhanced security.
Set OFF in IE Enhanced Security Configuration option, in both places- Administrators as well as in Users, and click on OK.


















That's it, you are done!

Now try to run the prerequisites setup again, this time it will smoothly download the components without fail.

Monday, 7 March 2016

Developer Dashboard in SharePoint 2013

How to enable it?

To enable the dashboard you need to create the Usage and Health Data Collection Service Application.

  Use the below power-shell command to create the service application.
New-SPUsageApplication -Name "Health and Usage Application" -DatabaseName "SP2013_Health_and_Logging_Database".
UsageApplication




Once you run the above command it will create the service application with the name Health and Usage Application and the respective database.
Once you have created the service application you have to enable the dashboard.
In the previous versions, we use to get three options ON/OFF/OnDemand settings for the dashboard.
Now in this version, you will get only two options ON/OFF.
To enable the dashboard, we will use ON setting and use the below PowerShell command.
$svc = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$dds = $svc.DeveloperDashboardSettings
$dds.DisplayLevel = "On"
$dds.Update()
After executing the above PowerShell command open your site on the top right-hand side of your site, you can see an icon to launch Developer Dashboard. Please see below Figure:1
You can enable the dashboard setting with object model as well.
Launch-developer-dashboard






Figure:1
Once you click on "Launch the developer dashboard" it will open the below Figure: 2
In that figure you can see what are requests, against each request you can observe server info, in server info  Aggregate status will give how many SQL queries have run, how many SharePoint requests and services has been called what is duration for each of them etc.
Developer-dashboard
Figure:2

SQL queries running against each request:
One of the most important criteria while designing the SharePoint solution is SQL. Because the performance of SharePoint depends on the SQL. We need for what type of queries runs in the background for each request so that it will be a great help for while troubleshooting the performance issues related to SharePoint.
Once you go to the SQL section of the dashboard you can see the queries name and execution plan details will get displayed once you click on those links.
Other than that there are few important parameters which will help us while troubleshooting the performance issue like what is the total duration to performance query, how many reads and write operations done by the query to the SQL server.
This makes easier for SQL DBA to troubleshoot the issues related to the performance of SharePoint.
Developer-dashboard-SQL Queries
Please see the below Figure where it displays the portion of a query execution plan.
Developer-dashboard-query-executionplan

ULS logs:

There are many cases where you want to check the error messages related to only that particular request.
In this dashboard, we have a separate section for the ULS logs to check against each and every request.




                                                                                                                                                                            One of the new features in SharePoint 2013 is a minimal download strategy. Earlier days whenever you access the page the complete page reloads again, it causes a decrease in performance. In SharePoint 2013 it's not the case, it will load the only portion of the page if there is any change so it drastically improves the performance of the application.
Developer-dashboard-MDS

Conclusion:

In this post we have seen how to enable developer dashboard in SharePoint 2013, what are the new features available in the dashboard and how this will help during troubleshooting issues related to SharePoint like most common performance issues.
Hope you have enjoyed this post.