Thursday 10 August 2017

Working With SharePoint Online Using Powershell - 1

Hi All,

Today I will define the steps and prerequisites for using Windows Powershell, Powershell ISE to manage available options in SharePoint Online, Office 365 SharePoint.
  1. For running Powershell commands/scripts in Office 365 SharePoint you will have to Install SharePoint Online Management Shell in a Machine where you want to run Powershell scripts. 
    1. It is not required to have any SharePoint Version installed on such machine. 
    2. Simply install SharePoint Online Management Shell and you will be able to run SharePoint online Powershell commands/scripts there for more details click here
    3. You only need to do this once for each computer from which you are running SharePoint Online Powershell commands/scripts.
    4. Download SharePoint Online Management Shell.
    5. Supported Powershell Version - 3.0 or later
    6. Supported Operating Systems - Windows 7 Service Pack 1, Windows 8, Windows 10, Windows Server 2008 Service Pack 2, Windows Server 2008 R2 SP1, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016.
    7. This installation will install Microsoft.Online.SharePoint.Powershell module in your windows modules that will further be used by Powershell.
  2. After installation of SharePoint Online Management Shell is done, user can run SharePoint Online Management Shell but remember to execute it with elevated credentials (administrator). For doing so search for SharePoint Online Management Shell in menu, right click on it and click on Run as Administrator.
  3. Basically SharePoint Online Management Shell is a normal Microsoft Windows Powershell window that imports a module Microsoft.Online.SharePoint.Powershell automatically on startup. So
  4. If you do not want to run SharePoint Online Management Shell, instead you want to use Windows Power Shell or Windows Power Shell ISE you can do so. Just use following command for the first time in Power shell before running any SharePoint Online Powershell Commands.
    • Import-Module Microsoft.Online.SharePoint.Powershell -DisableNameChecking
    1. This command will import SharePoint online Powershell module that is installed by SharePoint Online Management Shell.
    2. DisableNamechecking - parameter is used to suppress the message that warns you when you import a cmdlet or function whose name whose name includes an unapproved verb or a prohibited characters. This is only a warning and the complete module is still imported including the non-conforming commands for details click here.
    3. Make sure that you have started Windows Powershell or Windows Powershell ISE as Administrator otherwise Import may fail.
  5. The user who want to run SharePoint Online Powershell commands or scripts, Must be a Global Administrator in Office 365.

Saturday 15 April 2017

Whats new in SharePoint 2016 vs SharePoint older versions

Hi All,

Today I will defined whats new or depreciated in SharePoint 2016 in comparison to older versions. Basically there is no big change in SharePoint 2016 in comparison with SharePoint 2016. Most of Powershell commands, most of the features are same. Just there are some improvements in SharePoint 2016. Below is the list of the changes.
Whats New in SharePoint 2016 -

  1. Durable links - Now when ever you will change the name of documents, Move them inside SharePoint than resource based urls will retain the links. that means old URL will continue to work.
  2. Support for special characters in file names - SharePoint has historically blocked file names that included the &, ~, {, and } characters, file names that contained a GUID, file names with leading dots, and file names longer than 128 characters. These restrictions are removed in SharePoint Server 2016 and are now available to use.
  3. Central Administration is no longer provisioned on all servers by default  - SharePoint Server 2016 Central Administration is now provisioned on the first server in a farm by default when using the SharePoint Products Configuration Wizard. Central Administration is not provisioned on additional servers in a farm by default.
  4. Large file support - Previous versions of SharePoint did not support uploading or downloading files larger than 2,047 MB. SharePoint Server 2016 now allows you to upload or download larger files of up to 10 GB. You can configure the desired maximum file-size limit on a per-web application basis in your SharePoint farm.
  5. MinRole farm topology - Now user does not need to worry about the services running on a server. It will be taken care by SharePoint it self. Only required services will be started at a time on the server as per the selected role. The role of a server is specified when you create a new farm or join a server to an existing farm. SharePoint automatically configures the services on each server based on the server role, optimizing the performance of the farm based on that topology. There are total 8 roles defined for SharePoint servers - 
    1. Front-end - Service Application, Services and components that serve user requests will run on this server.
    2. Application - All Service Application, Services and components that serve back-end requests such as jobs will run on this server.
    3. Distributed Cache - All Service Application, Services and components that serve distributed cache will run on this server.
    4. Search - All Service Application, Services and components that serve Search Services will run on this server.
    5. Custom - In this role Farm admin will has full control over which service instances can run on servers. Min Role will not control any service in this installation.
    6. Single-Server Farm - All Service Application, Services and components that required for Single server farm will be executed on this server. A Single-Server Farm is meant for development, testing, and very limited production use. A SharePoint farm with the Single-Server Farm role cannot have more than one SharePoint server in the farm.
    7. Front-end with Distributed Cache - Shared role that combines the Front-end and Distributed Cache roles on the same server.
    8. Application with Search - Shared role that combines the Application and Search roles on the same server.

Resources - https://technet.microsoft.com/en-us/library/mt346121(v=office.16).aspx#file

Whats Depreciated/removed in SharePoint 2016 -

  1. SharePoint Foundation - Now SharePoint Foundation version has been depreciated from SharePoint 2016. That means is that there is no free version of SharePoint.
  2. Standalone Mode - Now Standalone installation mode has been depreciated in SharePoint 2016. Now user have to install SQL server manually and then configure SharePoint in Single server mode using "MinRole Feature" of SharePoint 2016 to install SharePoint as a single server installation. also no SQL version even sql express will be installed with SharePoint. Users will need to install SQL manually.
  3. ForeFront Identity Manager (FIM) - Now FIM client will not be used for synchronization between Active Directory and SharePoint 2016. Now Active Directory import process will be used and a tool such as Microsoft Identity Manager or any third party tool will be used to import Active Directory to SharePoint.
  4. SharePoint BI capabilities - If you want to use Microsoft SQL Server Power Pivot for SharePoint or Microsoft Power View for SharePoint for BI solutions with SharePoint Server 2016 you must install the Power Pivot or Power View add-ins for SQL Server 2016 RTM. The SQL Server 2014 (SP1) Power Pivot for SharePoint and Power View for SharePoint add-ins cannot be deployed or used withSharePoint Server 2016.
  5. Excel Services - Unlike in previous versions, Excel Services will not be a part of SharePoint Server in new version. Now Microsoft have introduced Office Online Servers (new version of Office Web Apps Server) and Excel Services will be a part of this new Office Online Servers. 
  6. Tags and Notes - This feature is deprecated in SharePoint 2016. This means is that users can use this feature in this version but Microsoft does not recommend using this feature because it will be removed in next release.
  7. Work Management Service - Work Management service application has been depreciated in SharePoint 2016. That means now we will not be able to view and track or to do task. It was a part of each users my site/Newsfeed Experience.
  8. Stsadm.exe - It is also deprecated in SharePoint 2016. That means as per Microsoft we should only use Windows Power Shell commands to perform any task in SharePoint instead of using Stsadm command.


Friday 20 January 2017

Using ULS Viewer to narrow down the issues in SharePoint

Regex Expression in ULS Logs - 
Using ULS Viewer to view and understand SharePoint Logs  more easily- 
  1. ULS viewer is a free ware tool that can be downloaded from https://www.microsoft.com/en-in/download/details.aspx?id=44020. This is a simple exe file that means it does not need any installation.  
  1. Open any log file in ULS viewer.  
  1. Image 
  1. You can connect your ULS viewer to Live SharePoint logs as well as old ULS log files. Use Ctrl + U to connect live SharePoint Logs and Ctrl + O to connect old logs. 
  1. Once the logs are opened you can see the logs and use different filters available for different columns. 
  1. Image 
  1. All the columns available in logs displayed under Field, You can choose the Operation (condition) on the field and type a value and if you want multiple conditions you can select from And/Or field. 
  1. All the operations in Operations columns are well known, so here I will define a special operation that is Regex match operation for different columns. 
  1. Regex Match is used to filter data dynamically on a given column. 
  1. Select the Field where you to apply filter, in Operation select Regex match, in Value enter your formula of regex match. And click on OK. 
  1. You will get the filtered data as per your requirements. 

How to create regex match formula - 
  1. Suppose you have this value "This is a test data" and you want to filter all that lines that contains the word test together. For this you can use contains and regex match both options. 
  1. But Regex match becomes useful when you want to filter the that that contains the characters between some range together. Such as you want all the lines that contains characters from e to t together that means any line that contains e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t together for a number of times such as 4 times. In the above test is the correct match for this condition. And the order of the text can be any it does not means that it should be a fix order. Like test, esttkjsl any text will satisfy this the regex match condition. 
  1. Now the formula for this will be [e-t]{4} that means 4 continuous characters having any character between e to t in any order will satisfy the condition. 
  1. The regex match also applies on numbers. And it is very helpful when we want to track that which thread is taking long time to response. We know that we have execution time defined the message field of ULS logs. So if we want to filter the messages that showing the execution time more then 1 second than this can be achieved through this process and formula - 
  1. In ULS the execution time is given in mili seconds and we know that 1 sec = 1000 Mili seconds. 
  1. As if we want to get the time more than 1 seconds than it means is that first character must b 1 to 9 and its next three characters must be 0 to 9 in any order. And the time will be written after 'Execution time=' so the formula for achieving this will be something like below - 
  1. Execution Time=[1-9]{1}[0-9]{3} 
  1. Here 'Execution Time=' is a constant so this will check "Execution Time=' first. 
  1. After getting 'Execution Time=' in any value of the message field it check the first character after the mark = must be between 1 to 9 it should not be 0 as we are checking for more then 1 second. This will be done by [1-9] range of the numbers and {1} define the number of characters. That is 1 as we want to check for 1st character after the = mark. 
  1. After getting 'Execution Time=N' here N can be any number between 1 to 9 it will check for next 3 characters that contains any combination of 0 to 9 characters.  This will be done by [0-9] range of the numbers and {3} define the number of characters. That is 3 as we want to check for 3 characters after the '=N' value. 
  1. So the result we will get is execution time that is more than 1000 mili seconds. And in this way you can make your regex formula. 

This Regex match option can be used to find out the performance issues with SharePoint, Such as which thread in SharePoint is taking longer time to complete. or find other issues.