Showing posts with label Office 365. Show all posts
Showing posts with label Office 365. Show all posts

Wednesday, 3 August 2016

Modern List Experience in SharePoint Online


The modern experience for SharePoint announced in the Future of SharePoint Event will be starting to roll out to first release customers during in First week of August. Microsoft also has provisioned a method to get early preview of the modern list experience even before the First Release roll out by adding TryNewExperience=true query string to the list URL as specified in the article https://network.office.com/t5/Blogs/Modern-SharePoint-lists-are-here-Including-integration-with/ba-p/3027 .

New UI

The new UI for list is clean and has command bar instead of ribbons.



Information Pane

Clicking the information icon at the top right displays the information panel which lists the recent activities that happened on the list.



The information panel for a selected list item shows the list properties, recent activities and sharing information.



Edit Properties

Properties including attachments can be edited in the information panel



Bulk editing of list is made easy with the Quick edit option



Modifying List and Views

New columns can be easily added to the list by clicking the + icon



Columns can be renamed, reordered, sorted and filtered from the column context menu



Flow Integration

A flow can be created by clicking the Flow menu from the top and selecting Add a flow



Selecting a flow template would take you to flow designer with the list context.

Tuesday, 14 June 2016

Redesigned Site Contents page in SharePoint Online


The redesigned SharePoint Online Site Contents page that provides details on activities happening on the site like site visit counts and trending contents, has started rolling out to first release customers. This blog explains the different sections that you would see on the new site contents page

Site visits

Site visit section shows the number of visits to the site within the last 7 days. The section also gives an indication of percentage change in the number of visits to the site.


Clicking the View report link in the top of Site visits box shows the Site report popup that gives details of site visits, new items added and trending content.


Trending content

Trending content section shows the popular items in the site over a rolling period of two weeks. Documents that are popular are listed along with number of views.

Contents

Contents tab lists all the lists and libraries within the site with details on number of items, type and modified date. Clicking on the ellipses (…) would give you menu options to go to list\library settings page or to the app details page.


Subsites

Subsites tab lists all subsites within the site with details of number of views, created date and modified date. Clicking on the ellipses (…) would give menu option to view site contents page of the subsite.


Top Navigation Panel

Top Navigation panel on the new site contents has the below links

1.      New – Provides link to create a new list, library, subsite or app.

2.      Site workflows – Navigates to the site workflows page.

3.      Site Settings – Navigates to the site settings page.

4.      Recycle bin – Navigates to the recycle bin page.

 


Wednesday, 13 April 2016

New document library experience coming to SharePoint Online


A new experience for document libraries is coming to SharePoint online and is being rolled out to first release customers. The new experience has some really cool options which I have listed in this blog

New UI

The new UI for document libraries is clean without ribbons.




Information Pane

Clicking the information icon at the top right displays the information panel which list the recent activities that happened on the document library.



The information panel for a selected document displays the preview of the document, the document properties, recent activities and Sharing information.



Modify View

Columns can be easily added or removed to the current view by clicking the ellipses at the right and selecting the columns required for the view



Grid View

Documents can now be arranged in grid view which shows a smart preview of documents.




Pinning Documents

Documents can now be pinned so that they are always displayed above the document list.


Wednesday, 16 March 2016

Set Mandatory Anonymous Links Expiration Duration in SharePoint Online

Recently added feature to SharePoint Online allows administrators to set the maximum expiration duration for documents shared via anonymous shared links. The maximum expiration period for anonymous shared links can be set by setting the RequireAnonymousLinksExpireInDays parameter of Set-SPOTenant cmdlet from SharePoint Online Management shell. The mandatory expiration duration is set at tenant level and therefore will affect all the links that are shared anonymously.

If the maximum expiration duration is not set users would be able to create anonymous share links 
that can be set to any date or create links that would never expires.


Below are the steps for setting mandatory expiration for anonymous links

1. Connect to SharePoint online tenant from SharePoint Online management shell. Version 16.9.4915.1200 of SharePoint Online Management shell is required for this feature. You can download it from here

2. Execute the Set-SPOTenant cmdlet with the RequireAnonymousLinksExpireInDays and the value for expiration duration 
E.g. Set-SPOTenant RequireAnonymousLinksExpireInDays 30

The value range for expiration duration is 0 to 730

3. Once the mandatory expiration duration is set , when users try to share a document with anonymous link the expiration date would be automatically set to the value of current date plus the expiration duration.


4. Users can change the expiration date by clicking the Change link and providing a value for expiration days.

5. If a user tries to set a value more than the maximum duration set, an error indicating that the expiration date cannot exceed the organizational policy would be shown.


6. To reset the expiration duration to default execute the Set-SPOTenant cmdlet with a value of 0 to RequireAnonymousLinksExpireInDays parameter.

Tuesday, 1 March 2016

Create Power BI Reports from Excel Files Stored in SharePoint Online Team Sites

As part of recent Power BI service update the ability to use excel files stored in SharePoint Online team sites was announced. This blog post explains the steps for creating Power BI report from excel file stored in SharePoint online tea site

1.       Logon to PowerBi.com
2.       Click on Get Data from left navigation
3.       In the Get Data page click Get link in the files source

4.       In the files page click SharePoint – Team Sites as the source

5.       You will be prompted to enter the URL of the SharePoint site. Enter the URL of the SharePoint site like https://contoso.sharepoint.com/teams/sales and click Connect button.



6.       You will be presented from the list of libraries to choose from. Click the library in which you have excel file to be used for Power BI. If you have the file within a folder then select the folder.

7.       List of Excel files in the library or folder will be listed. Select the Excel file you want to use as source and click the Connect button at top right.


8.       From the Choose how to connect page click Import button in Import Excel data into Power BI option

9.       After processing your Excel file Power BI will create a new data set.


10.   You will then be create charts and dashboards from the data set created from Excel file.

Friday, 31 July 2015

Could not load the assembly 'Microsoft.SharePoint,Version=16.0.0.0’ error when moving sites from Office 365 SharePoint Online to On Premise SharePoint 2013


Recently one of my clients who were using Office 365 SharePoint Online wanted to have a backup of their sites in their on-premise SharePoint environment. I used a leading SharePoint migration tool and was able to back up the sites to on premise SharePoint. But when trying to open a site or a document library I ran into the error “Could not load the assembly 'Microsoft.SharePoint,Version=16.0.0.0’”

The issue happened because Office 365 SharePoint Online is has been updated to version 16 of SharePoint DLL while the on-premise SharePoint 2013 server had version 15 of the DLL. All the pages for sites, libraries and lists were pointing to the version 16 of the DLL.

 If it was single page a quick fix would have been to open the page in SharePoint Designer and change the version of DLL to 15. But since there were many sites and sub sites with lots of libraries and list I wrote a PowerShell script(courtesy http://www.sharepointdiary.com/2013/02/create-update-copy-delete-views-powershell.html) to create new views for all lists and libraries and make them as default views. As the new view pages are referencing version 15 of Sharepoint the sites and libraries sprang back to life.
 


Thursday, 11 June 2015

Calling Office 365 Unified API (Preview) from Java script using ADAL for JS

Office 365 unified API provides developers with a single endpoint for accessing all Office 365 data and relationships, including Users, Groups, Files, Mail, Calendar, Contacts and Office Graph. Office 365 Unified API removes the complexity in accessing Office 365 data and makes development simpler. Developers have a choice of calling the REST API or use client libraries that are available for .Net, Android and iOS platforms.  In this blog I’ll explain the process of calling the Office 365 Unified from Java script using ADAL for JS.

For developing a Java script application with Office 365 Unified API the below prerequisites have to be met

1.       Web site development tool of your choice(Visual Studio in my case)
2.       Office 365 Tenant ( Trial subscription can be used)
3.       Microsoft Azure Tenant (Trial subscription can be used).

Note: The Azure subscription should be tied to the Office 365 account.

Once we have the prerequisites ready we can start with development of the application.  The first step is to register the application Azure.

Register the application Microsoft Azure

  1. Logon to Azure Management Portal, using your Azure AD credentials.
  2. Click Active Directory on the left menu, then select the directory for your Office 365 tenant.
  3. Click Applications from the top menu.
  4. Click Add from the bottom tray.
  5. On the What do you want to do? page, select Add an application my organization is developing.
  6. On the Tell us about your application page, enter the application name as O365UnifiedAPIWithJavaScript and select the type as Web application and/or web API.
  7. Click the arrow on the bottom right to move to next page.
  8. On the Application information page, specify the app SIGN-ON URL and APP ID URI and then click the tick mark on bottom right. The SIGN-ON URL is our app's web address including the port number. For example http://localhost:55389/start.html.  For the App ID URI, enter https://<tenant_name>/O365UnfiedAPIWithADALJS where <tenant_name> is the name of Azure AD tenant.
  9. Once the application has been added, you will be taken to the Quick Start page for the application. From the application page, click Configure from the top menu.
  10. Copy the value specified for Client ID on the Configure page and save it to notepad or similar tool.
  11. Click Add application button under permissions to other applications section and in the dialog box that opens, select the Office 365 unified API (preview) application and click the tick mark on bottom right.
  12. On the application configuration page, select Office 365 unified API (preview) and select Read users’ files permission.
 
 13. Click Save in the bottom menu.

Now that the app has been registered in Azure we can start developing the Java Script application. For this example I will be using a Java Script application that lists files from users One Drive.

1.       Start Visual Studio and create an empty ASP.Net web project.
 
2.       Add a new HTML file to the project and name it as start.html. Add button input elements to the page for login, logout and showing files. Add pre elements for showing the result, error and loading message.

3.       The content of start.html will be similar to

<html>
<head>
    <title>Office 365 Unified API and ADAL JS</title> 
</head>
<body >

    <div>
        <input type="button" id="btnLogin" value="Login">
        <input type="button" id="btnLogout" value="Logout" hidden>
        <br />
        <pre id="lblUser"></pre>
        <input type="button" id="btnFiles" value="Show Files" hidden>
        <br />
        <pre id="lblLoading" hidden>Loading Files...</pre>
        <pre id="lblFiles" hidden></pre>
        <pre id="lblError" hidden></pre>
    </div>
    <br />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="https://secure.aadcdn.microsoftonline-p.com/lib/1.0.0/js/adal.min.js"></script>
    <script src="Scripts/app.js"></script>
</body>
</html>
 
4.       Add reference to ADAL. and JQuery JS from CDN source

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<script src="https://secure.aadcdn.microsoftonline-p.com/lib/1.0.0/js/adal.min.js"></script>
5.       Add a java script file with the name app.js to the project. This file will have the code that connects to office 365 unified API via ADAL and list the files from users One Drive.
6.       adal.js exposes a class AuthenticationContext that handles the authorization and token acquisition process. Within our app.js we initialize the AuthenticationContext class by passing the configuration values
      configuration = {

        tenant: '<tenant_name>',

        clientId: '<client_ID>',

        postLogoutRedirectUri: '<redirect URL>',

        endpoints: 'https://graph.microsoft.com',

        cacheLocation: 'localStorage',

      };

      var authContext = new AuthenticationContext(configuration);
In the code above tenant is <tenant_name> is the name of Azure AD tenant, <client_ID> is the client ID of the App we have copied from Azure App configuration page, <redirect URL> is the url to which the Azure will redirect after login.

7.       Then we create a method called ShowFiles that will be invoked with the show files button on the HTML page is clicked.  Within this method will write code to call the Office 365 unified API end point https://graph.microsoft.com to acquire token and the use to token to make subsequent call to the files endpoint https://graph.microsoft.com/beta/me/files . If the call to files endpoint is successful we loop through the response to form a HTML table that lists the files.

8.       The complete code in app.js will be similar to

(function () {
      configuration = {
        tenant: 'tenant_name',
        clientId: 'client_id',
        postLogoutRedirectUri: 'redirect url',
        endpoints: 'https://graph.microsoft.com',
        cacheLocation: 'localStorage', // enable this for IE, as sessionStorage does not work for localhost.
      };

      var authContext = new AuthenticationContext(configuration);

    var $loginButton = document.getElementById("btnLogin");
    var $logoutButton = document.getElementById("btnLogout");
    var $filesButton = document.getElementById("btnFiles");
    var $lblUser = document.getElementById("lblUser");

    // Handle Redirect From AAD After Login
    var isCallback = authContext.isCallback(window.location.hash);
    authContext.handleWindowCallback();
    //$errorMessage.html(authContext.getLoginError());

    if (isCallback && !authContext.getLoginError()) {
        window.location = authContext._getItem(authContext.CONSTANTS.STORAGE.LOGIN_REQUEST);
    }

    // Hide and show elements based on login status
    var user = authContext.getCachedUser();
    if (user) {
      
        $loginButton.hidden = true;
        $logoutButton.hidden = false;
        $filesButton.hidden = false;
        $lblUser.innerText = "Welcome " + user.profile.name;
    } else {
    
        $loginButton.hidden=false;
        $logoutButton.hidden = true;
        $filesButton.hidden = true;
        $lblUser.innerText = "";
    }

 //Add event handlers for button clicks
    $loginButton.onclick = function () {
                authContext.login();
    };

    $logoutButton.onclick = function () {
        authContext.logOut();
    };

    $filesButton.onclick = function () {
        ShowFiles();
    };

    //Get files from OneDrive and list in a table
    function ShowFiles() {
        // Empty old view contents.
        var $lblLoading = document.getElementById("lblLoading");
        var $lblError = document.getElementById("lblError");
        $lblLoading.hidden = false;
                console.log("Fetching files from OneDrive...");
        // Acquire token for Files.
                authContext.acquireToken('https://graph.microsoft.com', function (error, token) {

                    // if there is an error in ADAL
                    if (error || !token) {
                        $lblError.innerText = 'ADAL exception : ' + error;
                        
                        return;
                    }
                    $.ajax({
                        type: "GET",
                        url:  "https://graph.microsoft.com/beta/me/files",
                        headers: {
                            'Authorization': 'Bearer ' + token,
                        }
                    }).done(function (response) {

                        var output = '<table cellspacing="0" cellpadding="5" border="1"><tr><th>File Name</th><th>Type</th></tr>';
                        //Loop through response and form files HTML output
                        response.value.forEach(function (item) {                         
                            output += "<tr><td>" + item.name + "</td><td>" + item.type + "</td></tr>";
                        })
                        output += "</table>";
                        var $lblFiles = document.getElementById("lblFiles");
                        $lblLoading.hidden = true;
                        $lblFiles.innerHTML = output;
                        $lblFiles.hidden = false;
                        $filesButton.hidden = true;
                    }).fail(function () {
                        console.log('Problem in fetching files from OneDrive.');
                        $lblError.innerText = 'Problem in fetching files from OneDrive.';
                        $lblError.hidden = false;    
                    });
                });
    }
}());
 
9.       Add a reference to app.js in start.html

10.   Now if we open start.html in a browser a login button will be displayed clicking which will redirect to Azure login page. After successful authentication we will be taken back to start.html in our web application and the Show Files button will be displayed.

11.   Clicking the Show Files button will list the files stored in One Drive for the logged in user as shown below.