Sunday, 23 September 2018

SharePoint 2019 - Things To Know

Microsoft has announced the next on premises version of SharePoint Server will be called SharePoint 2019 and the preview will be available mid-year in 2018.

SharePoint  

Next-Gen Sync Client Support
The Sync Client allows users to synchronize content from SharePoint with their local computers, similar to the tool used for OneDrive for Business; the Sync Client had a checkerd early history but has steadily improved in the Office 365 space. Expect a fast and reliable synchronization experience. It should be noted that Microsoft does not intend to bring support for the Sync Client to SharePoint Server 2016.

Modern UX throughout the product 
Modern lists, libraries and pages (let’s hope it means Communication sites, hub sites etc..)

SharePoint  
 
Flow / Power Apps integration 

List integration with Flow and PowerApps (more than what we have today). I expect this also means our ability to more easily generate flows to move data from on prem to cloud and vise versa. Microsoft has now confirmed PowerApps and Microsoft Flow as its successor products to InfoPath and SharePoint Designer, used for forms and workflow development respectively, by developers and power users. Interestingly for InfoPath, the form-building tool that's enjoyed a love-hate relationship with SharePoint developers for over a decade, talk of its imminent demise seems premature. Microsoft has flagged its continuation to at least 2026, in line with the expected lifespan of SharePoint Server 2016. 

In summary, SharePoint Server 2019 is shaping up as a significant product release. It will continue to support Microsoft customers who wish to maintain the capability for on-premises content storage, while leveraging Microsoft's investments in Office 365 and SharePoint Online, to bring state-of-the-art functionality to SharePoint Server.

How To Join The Office 365 Developer Program

Hello folks, I am writing this article with my personal experience in creating a free developer subscription for Office 365 for one year.
Here are the steps to be followed.
  1. Create a Microsoft Account (Outlook, live, Skype etc...) if you don’t have one. I have created a Microsoft account using Outlook.
  2. Login to this site using the Outlook account credentials.

    Office 365
  1. Click on Join Now and fill out the required fields. Then, click "NEXT".

    Office 365
  1. Select the areas of your interest and click "JOIN".

    Office 365

    Office 365
  1. After a few minutes, you’ll get the below welcome screen which asks you to set up a new Office 365 developer subscription.

    Office 365
  1. Click "SET UP SUBSCRIPTION" to proceed.

    Office 365
  1. Fill up the required fields and click on "Set up".

    Office 365

    Office 365
  1. On successful process completion, you’ll be seeing your subscription information, click on "office.com" and sign in using your newly created subscription name and password.

    Office 365
  1. Once you sign in for the first time, you’ll be landing in the Office365 Homepage, click on the "Admin Link" to get started.

    Office 365
  1. You’ll get the welcome screen which will take you on a small tour about the navigation.

    Office 365
  1. Once you get familiar with the navigational elements, here comes the most important step for Office 365 Enterprise E3 Developer setup. On the Admin Center home page, you’ll be able to find the setup screen to proceed forward. Click on "Go to setup" to proceed. If you are not able to find the below screen. Search in the search bar on top of the page.

    Office 365
  1. Once you click on Go to Setup, you’ll be landing in a page to choose the domain where you get the option to choose the domain of your choice which you already own else you continue using the one which you just created here for the O365 subscription. I choose option 2 and click "Next".

    Office 365
  1. Here comes the license part. You have 25 of 25 license(s) available for this subscription to make use of. It’s up to you how you make use of it. I leave it blank and clicking "NEXT".

    Office 365
  1. Now assign the license for the user which I am going to use for the development activity which means you have 24 of 25 license(s) available. Click on next.

    Office 365
  1. We will get the option of sharing the credentials of the user by giving their alternate Email ID.

    Office 365

    Office 365
  1. Click on "Next". You get the option to install the Office apps to your PC’s up to 5 devices. It’s up to you if you install it or not. Click on "Next" to proceed.

    Office 365

    Office 365
  1. That’s all. We are done with setting up the subscription. Set your password to never expire as an important recommendation. Click on "View Recommendation" and save and close.

    Office 365

    Office 365


    Office 365
  1. Finally, we can make use of the subscription to get started with the development activity for Office and SharePoint Online solutions like Powerapps, OneDrive etc...

    Office 365
  1. Play around with the "Admin Site" to get familiar with the navigation and get things done.
  1. Say, for example, you wanted to go creating a Communication site in SharePoint online, click on SharePoint from the O365 root menu.

    Office 365

    You’ll get landed in the SharePoint Online home page for creating sites to work with.

    Office 365
  1. Click on Create site > Communication site.

    Office 365
  1. Give a name for the site and click "Finish".

    Office 365
  1. Your first communication site gets created in a matter of seconds. 

    Office 365
Sharing is caring!!
Happy SharePointing!!

Get All Checked Out Items From A Site Collection Using PowerShell In SharePoint 2013

At some point, your architect/manager/customer may ask you to perform a SharePoint Migration from one version to another version. At that time, you'll be asked to analyze a lot of factors, like total data to be migrated, workflows, solution files etc. Along with that, one of the most important things is files uploaded in the document library.
SharePoint
Let’s say, for example, you use the Metalogix Context Matrix tool. In that, the checked out files in document library won't be migrated. To identify the files which are checked out in the entire site collection is a very tedious task manually. The below piece of PowerShell code makes life easier by getting the checked out files in the site collection in one shot. Here is the PowerShell code which will get the document library items from the site collection which are checked out. 
  1. #Add the PowerShell SnapIn Add - PSSnapin microsoft.sharepoint.powershell  
  2. # Enter the Site Collection URL $spWeb = Get - SPWeb "http://insiscvmsrv70:8888/sites/KM/"  
  3. #Function to get the CheckedOut items in document library  
  4.   
  5. function GetCheckedItems($spWeb) {  
  6.     Write - Host "Scanning Site: $($spWeb.Url)"  
  7.     foreach($list in ($spWeb.Lists | ? {  
  8.         $_ - is[Microsoft.SharePoint.SPDocumentLibrary]  
  9.     })) {  
  10.         Write - Host "Scanning List: $($list.RootFolder.ServerRelativeUrl)"  
  11.         foreach($item in $list.CheckedOutFiles) {  
  12.             if (!$item.Url.EndsWith(".aspx")) {  
  13.                 continue  
  14.             }  
  15.             $writeTable = @ {  
  16.                 "URL" = $spWeb.Site.MakeFullUrl("$($spWeb.ServerRelativeUrl.TrimEnd('/'))/$($item.Url)");  
  17.                 "Checked Out By" = $item.CheckedOutBy;  
  18.                 "Author" = $item.File.CheckedOutByUser.Name;  
  19.                 "Checked Out Since" = $item.CheckedOutDate.ToString();  
  20.                 "File Size (KB)" = $item.File.Length / 1000;  
  21.                 "Email" = $item.File.CheckedOutByUser.Email;  
  22.             }  
  23.             New - Object PSObject - Property $writeTable  
  24.         }  
  25.         foreach($item in $list.Items) {  
  26.             if ($item.File.CheckOutStatus - ne "None") {  
  27.                 if (($list.CheckedOutFiles | where {  
  28.                         $_.ListItemId - eq $item.ID  
  29.                     }) - ne $null) {  
  30.                     continue  
  31.                 }  
  32.                 $writeTable = @ {  
  33.                     "URL" = $spWeb.Site.MakeFullUrl("$($spWeb.ServerRelativeUrl.TrimEnd('/'))/$($item.Url)");  
  34.                     "Checked Out By" = $item.File.CheckedOutByUser.LoginName;  
  35.                     "Author" = $item.File.CheckedOutByUser.Name;  
  36.                     "Checked Out Since" = $item.File.CheckedOutDate.ToString();  
  37.                     "File Size (KB)" = $item.File.Length / 1000;  
  38.                     "Email" = $item.File.CheckedOutByUser.Email;  
  39.                 }  
  40.                 New - Object PSObject - Property $writeTable  
  41.             }  
  42.         }  
  43.     }  
  44.     foreach($subWeb in $spWeb.Webs) {  
  45.         GetCheckedItems($subWeb)  
  46.     }  
  47.     $spWeb.Dispose()  
  48. }  
  49. GetCheckedItems($spWeb) | Out - GridView  
  50. # As an alternate option you can export the data to a textfile as well.Uncomment below code to do that  
  51. # GetCheckedItems($spWeb) | Out - File c: \CheckedOutItemsInSiteCollection.txt - width 300  
Once you run the PowerShell script using PowerShell ISE, you get the below output.
Output

Hope it helps fellow developers.

Console App To Get The Total Number Of Lists And Its Item Count For Multiple Site Collection In SharePoint 2013 Using C# CSOM

This article talks about how to get the list of source lists/libraries with the item count for multiple site collections at one shot.

Consider a scenario where you have around 100 site collections in your farm which you are planning to migrate from SharePoint 2013 to SharePoint Online. Going to each site collection and getting the data is a tough job. So what I am going to do is to write a Console app using C# and perfom the activity at one go. It's a pretty simple method which should save a lot of time and we can focus on other important migration aspects.

Here are the steps involved in the development,

Step 1
Go to your SharePoint 2013 dev machine/server and open Visual Studio.


Step 2
Select File > New > Project > Console Application give a name. Lets say "GetSourceListData" and click on OK.


Step 3
Create a .CSV file with two columns, Site Collection Name and Site Collection URL


Step 4
Come back to Visual Studio and add the below references and refer to those in the .cs file.

 
  1. using SP = Microsoft.SharePoint.Client;  
  2. using System;  
  3. using System.Collections;  
  4. using System.Collections.Generic;  
  5. using System.IO;  
  6. using System.Linq;  
  7. using System.Text;  
  8. using System.Threading.Tasks;  
  9. using Microsoft.SharePoint.Client;  
  10. using System.Data;  
  11. Step 5  
  12. Add the below piece of code to your.cs file under the class  
  13. /// <summary>  
  14. /// Start for the Program  
  15. /// </summary>  
  16. /// <param name="args"></param>  
  17. static void Main(string[] args) {  
  18.     //Source Site Collection CSV File Path  
  19.     String filePath = @ "C:\SiteCollectionList.csv";  
  20.     GetSourceList(filePath);  
  21. }  
  22. /// <summary>  
  23. /// Read the data from CSV File  
  24. /// </summary>  
  25. /// <param name="filePath"></param>  
  26. public static void GetSourceList(string filePath) {  
  27.     var reader = new StreamReader(System.IO.File.OpenRead(filePath));  
  28.     Hashtable htSiteCollectionInfo = new Hashtable();  
  29.     //skip First Row in CSV File  
  30.     reader.ReadLine();  
  31.     while (!reader.EndOfStream) {  
  32.         var line = reader.ReadLine();  
  33.         var values = line.Split(',');  
  34.         //Add the Site Collection Name and Url to Hash Table  
  35.         htSiteCollectionInfo.Add(values[0].Trim(), values[1].Trim());  
  36.     }  
  37.     DataTable SourceData = new DataTable();  
  38.     SourceData.Columns.Add("Site Collection Title");  
  39.     SourceData.Columns.Add("List Title");  
  40.     SourceData.Columns.Add("Items Count");  
  41.     SourceData.Columns.Add("Site Collection Url");  
  42.     // For retrieving elements in the HashTag  
  43.     foreach(DictionaryEntry e in htSiteCollectionInfo) {  
  44.         GetListProperties(e.Key.ToString(), e.Value.ToString(), SourceData);  
  45.     }  
  46.     StringBuilder sb = new StringBuilder();  
  47.     DataTable dt = SourceData;  
  48.     foreach(DataRow dr in dt.Rows) {  
  49.         foreach(DataColumn dc in dt.Columns)  
  50.         sb.Append(FormatCSV(dr[dc.ColumnName].ToString()) + ",");  
  51.         sb.Remove(sb.Length - 1, 1);  
  52.         sb.AppendLine();  
  53.     }  
  54.     System.IO.File.WriteAllText("D:\\Sample\\SourceList.csv", sb.ToString());  
  55. }  
  56. /// <summary>  
  57. /// Get the List Properties like List Title, ItemCount etc...  
  58. /// </summary>  
  59. /// <param name="siteTitle"></param>  
  60. /// <param name="siteUrl"></param>  
  61. /// <param name="SourceData"></param>  
  62. public static void GetListProperties(String siteTitle, String siteUrl, DataTable SourceData) {  
  63.     ClientContext clientContext = new ClientContext(siteUrl);  
  64.     Web oWebsite = clientContext.Web;  
  65.     ListCollection collList = oWebsite.Lists;  
  66.     clientContext.Load(collList);  
  67.     clientContext.ExecuteQuery();  
  68.     foreach(SP.List oList in collList) {  
  69.         //Console.WriteLine("Title: {0} | Items Count: {1} | Site Title:{2}", oList.Title, oList.ItemCount, siteTitle);  
  70.         SourceData.Rows.Add(siteTitle, oList.Title, oList.ItemCount, siteUrl);  
  71.     }  
  72. }  
  73. /// <summary>  
  74. /// Function to format the datatable to CSV for exporting it to CSV File  
  75. /// </summary>  
  76. /// <param name="input"></param>  
  77. /// <returns></returns>  
  78. public static string FormatCSV(string input) {  
  79.     try {  
  80.         if (input == nullreturn string.Empty;  
  81.         bool containsQuote = false;  
  82.         bool containsComma = false;  
  83.         int len = input.Length;  
  84.         for (int i = 0; i < len && (containsComma == false || containsQuote == false); i++) {  
  85.             char ch = input[i];  
  86.             if (ch == '"') containsQuote = true;  
  87.             else if (ch == ',') containsComma = true;  
  88.         }  
  89.         if (containsQuote && containsComma) input = input.Replace("\"""\"\"");  
  90.         if (containsComma) return "\"" + input + "\"";  
  91.         else return input;  
  92.     } catch {  
  93.         throw;  
  94.     }  
  95. }  
Step 6
DONE!! Now its time for testing and debugging if requried.

Step 7
Basically what the code does is get the input data (Site Collection Name and Site Collection URL) from the CSV file, iterate all the site collections, and get the list data like title and item count, and export it the .CSV file.

Step 8
It's a pretty simple job considering if more number of site collections are present.

Output CSV File ScreenShot ,

 

Happy Coding!!

Featured post

Getting Started with Hub Sites in SharePoint Online

Hello Folks, Today, I have just Completed my First C# Corner Webinar on the topic Getting Started with Hub Sites in SharePoint Online . W...

Popular Posts