9/25/2016

You Can Now Create "Modern" Pages in SharePoint Online

 

It looks like "modern pages" are now rolling out to the tenants with the preview options on. You can still create Wiki Pages and Web Part Pages in addition to the new "Site Page" type. Here's both the new and classic Site Pages library “New” menus.

image   image_thumb[11]

The new pages have the "warm and fuzzies". Click to enter a page name. Note the Publish button. New pages are left checked out until "published". Major versions are enabled on the Site Pages library.

image

While web parts are not listed yet, you can add some "widgets" to the new pages. (Hey! There's a Yammer thing there!)

image

 

So… stay tuned to see what will appear next!

 

.

8/20/2016

Hide the Windows Explorer Button in SharePoint Libraries

 

Tested in SharePoint 2013, 2016 and SharePoint Online.

 

The Windows Explorer view of a SharePoint library has so many issues that I'm often asked to hide it. Turns out that this is pretty easy to do. Two solutions:

  • Create a SharePoint Feature and deploy it to the desired site collections.
  • Add CSS to your master page, or to selected view pages.

 

Create a SharePoint Feature and deploy it to the desired site collections

This is the best solution! And it's been documented elsewhere: https://blogs.msdn.microsoft.com/tejasr/2010/07/19/how-to-remove-open-with-windows-explorer-button-from-document-librarys-ribbon-menu/

I would only add one more step to this solution… make sure the WSP file does not include an unneeded DLL so the solution can be deployed to SharePoint Online. (No code allowed!) The one extra step: In the project's Properties panel click "Include Assembly in Package" and change it to False.

Once the Feature has been installed in the Site Collection, just visit each subsite and activate the feature. This will impact all libraries in the site.

 

Add CSS to your master page, or to selected view pages

Add one little piece of CSS to your master page, or open SharePoint Designer and edit the library's views to add a CSS block and the button will disappear. If added to the master page then this will impact every library in the site. If added to a view page, then it will impact only that view.

This CSS will not work with the SharePoint Online “New Library Experience”. But then the new “experience” does not currently include a link for Windows Explorer!

The CSS:

<style type="text/css">
  #Ribbon\.Library\.Actions\.OpenWithExplorer-Small {
    display: none;
  }
</style>

Note: The backslashes have been added to the ID due to the non-standard naming convention that uses periods.

If you would like site owners to still be able to see the button then wrap additional CSS in a SharePoint:SecurityTrimmedControl. Note that this control can only be added directly to a page, typically using SharePoint Designer. It will not work if added to a Content Editor Web Part.

<style type="text/css">
  #Ribbon\.Library\.Actions\.OpenWithExplorer-Small {
    display: none;
  }
</style>
<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="ManageWeb">
  <style type="text/css">
    #Ribbon\.Library\.Actions\.OpenWithExplorer-Small {
      display: inline;
    }
  </style>
</SharePoint:SPSecurityTrimmedControl>

 

.

8/18/2016

Auto-populated Choice Columns in SharePoint!

 

This was tested in SharePoint 2013 and 2016.

Had a list with 100,000 items with a State column. I found that some of my users did not know their state abbreviations. (KE is Kentucky?) After cleaning up the "nonstandard" states, I decided to convert the column from Single Line of Text to Choice.

Magic!

After editing the column and clicking "Choice" I scrolled down and found that the list of choices was already populated!

image_thumb[1]

For this to work for lists with more than the List View Threshold number of items (5,000 by default) you will need to be:

  • a server administrator, or
  • an auditor (Configured in Web Application settings, and only for under 20,000 items.), or
  • working with the list during Happy Hour!  (Offically “Daily Time Window for Large Queries”.)

 

Bonus!

The State column was now available in my Metadata Navigation Settings options.

image_thumb[2]image_thumb[3]

 

Too Easy!

In the future when importing large amounts of list data I’ll just make the columns that should be Choice as Single Line of Text and then after the import change them to Choice.

.

SharePoint 2016: List View Threshold Limit to Delete a List is 99,993 Items???

 

SharePoint 2013 had a default List View Threshold that used the number 5,000 for a lot of limits. SharePoint 2016 has made a few changes to the List View Threshold to give us a little more flexibility. If you take a look at the TechNet article “Software boundaries and limits for SharePoint Server 2016” you will find that the old 5,000 limit is still there for normal list activity, but they have made a few changes for Site Owner maintenance activities.

These include:

  • When adding or removing a column index, the threshold is 20,000 by default.
  • When deleting a list or folder, the threshold is 100,000 by default.
  • When renaming a folder within the same library, the threshold is 100,000 by default.

Note that these limits are for Team Members, Site Owners and Site Collection Administrators. Server administrators can exceed these limits and everyone can during “happy hour!” (Officially, the “Daily Time Window for Large Queries” limit set by the SharePoint Server administrators.)

As I am working on a new course, “Microsoft SharePoint Server Content Management for SharePoint 2013 and 2016”, I have to both test these limits and create screen captures for classroom demos. I ran into two interesting discoveries:

  • I could rename folders when there were more than 100,000 items. So this one must be for when there are up to 100,000 folders at the same level.
  • I could NOT delete a list with 100,000 items. Or, 99,999 items.

The delete issue was a bit more interesting… I started deleting items, even emptied the Recycle Bin after each delete, but still could not delete the list… until I hit 99,993 items. Weird huh? That number is not even a magic number (a power of 2). I guess there must seven hidden, for SharePoint’s use only, items in that large list. Who knows…

I could not delete the following list until the item count was below 99,994.

image

99,993… now I can delete it.

image

 

Now… should I go an tie up the bandwidth to create a 100,000 item list in SharePoint Online to test there?

Of course!

 

.

8/15/2016

Get the Version Number of a PowerShell Module

 

When a PowerShell script works for one person, but not for another, sometimes it's because the PowerShell module is a different version.

To find the version number:

Get-Module -ListAvailable "Microsoft.Online.SharePoint.PowerShell" | 
select name, version

 

If you need to deal with multiple versions in your scripts:

if ( (Get-Module -ListAvailable "Microsoft.Online.SharePoint.PowerShell").
  Version.ToString() -eq "16.0.4915.0")
  { … do this }
else
  { … do this }

or maybe

if ( (Get-Module -ListAvailable "Microsoft.Online.SharePoint.PowerShell").
   Version.ToString() –lt "16.0.4915.0")
   { "Must have 16.0.4915.0 or later"; Return; }
.

8/11/2016

Using Relative URLs in SharePoint 2013 Workflow Calls

 

(For SharePoint 2013, 2016 and SharePoint Online.)

It's generally a good idea to use relative URLs when creating something that you will want to use in more than one place. While not real obvious, you can easily do this in SharePoint 2013 workflow web service calls.

Absolute URL:
   http://yourServerName/sites/yourSiteName/_api/web

Relative URL:
   /sites/yourSiteName/_api/web

What we would like to have in a workflow web service call:
   _api/web

Steps:

  1. After adding your Call HTTP Web Service action, click “this”
    image.
  2. Click the "" button to open the String Builder dialog.
     image
    1. Click the Add or Change Lookup button.
    2. For Data source select Workflow Context.
    3. For Field from source select Current Site URL.
    4. Immediately after the lookup place holder (i.e. no spaces) type the rest of the URL for the web service call:
         _api/web

      image
    5. Click OK.
  3. Continue with web service call action configuration…

 

As you can probably guess… I’m working on a new class that includes workflows!

.

8/02/2016

PowerShell to Find SharePoint Views Configured for More Than 5000 Items

 

Have any of your site owners been trying to create views with more than 5000 items? Have you changed the row limit to more than 5000 and have decided to set it back? Here’s some PowerShell to find all Views with a RowLimit set to more than 5000.

Here’s some PowerShell to find those views in an on premise SharePoint.

Get-SPSite -Limit All | 
   Select -ExpandProperty AllWebs |
   Select -ExpandProperty Lists |
   Select -ExpandProperty Views |
   Where {$_.RowLimit -gt 5000} |
   Select {$_.ParentList.ParentWebUrl}, {$_.ParentList.Title}, {$_.ParentList.ItemCount}, {$_.paged}, {$_.RowLimit} | ft -autosize

 

There are two properties of interest in the View object:

  • Paged – Boolean – is paging enabled for the view.
  • RowLimit – integer – number of items to display per page.

If you wanted to only include views without paging then change the Where line to:

    Where { ($_Paged –eq $false) –AND ($_.RowLimit -gt 5000) } |

 

.

7/29/2016

SharePoint Online / Office 365 “Modern Library” Blank Pages

 

One of my PCs cannot display any of the new “Modern Lists / Library Experience” pages, including the OneDrive for Business pages. The pages are just blank. The issue turned out to be a URL that was in one of my blocked lists that is used to load a JavaScript library used by these new pages:
<script type="text/javascript" src="https://spoprod-a.akamaihd.net/files/odsp-next-prod_ship-2016-07-18_20160720.003/require-951f856e.js">

Removing akamaihd.net from my blocked list let these pages work again. The weird part is that this was only an issue in Internet Explorer 11. The pages loaded fine when using FireFox.

 

About the “Modern Library” Pages

These pages are almost completely generated from JavaScript, not HTML embedded in the page. If you use IE’s View Source command you will find that these pages are actually a bit weird, at least from an HTML point of view. The W3 validator page (http://validator.w3.org/check) has nothing nice to say about these pages!

  image

The page as delivered, before the JavaScript runs, basically looks like this:

  • A DOCTYPE directive that says the following is XHTML (but the W3 validator has issues with this):
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  • An HTML tag that includes two meta tags and a number of <script> tags:
      <html dir="ltr" lang="en-US"><meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    • A meta tag (outside of the HTML and HEAD tags!):
        <meta name="viewport" content="width=device-width,   …   />
    • A link tag to an icon:
        <link rel="shortcut icon" href="_layouts/15/images/favicon.ico   …   />
    • Seven script blocks, one of which points to an external source:
        <script …. ></script>
    • There are no <HEAD> tags!
  • An end HTML tag:
       </html>
  • An then an empty <BODY> tag:  (And I thought this had to be between <HTML> and </HTML>!)
      <body>   </body>
  • And then several <script> tags (again outside of <HTML> … </HTML>!):
      <script …. ></script>

 

Oh, customizers take note, the traditional SharePoint master pages are not used here! There go all of our customizations… so far anyway.

 

.

7/19/2016

Use the Visual Basic Financial Functions from PowerShell

 

You may already know that you can access the core .NET libraries like System.Math from PowerShell:

  image

As “System” is the default namespace, you could just type [Math]::Sqrt(2).

But what if you wanted to do a quick financial calculation from PowerShell? Maybe calculate the monthly payment for the classic Mustang you just just have to have? Just use the Visual Basic financial library. In the example below, at 5% (.05/12 per month), over five years (5*12 payments) and an amount of 20,000, your payment would be 377.42 per month. (The minus sign is what it will do to your checking account.)

  image

Find the available methods…

While you could search MSDN for a list of methods available from these libraries, you could also just ask the library! Just call the GetMethods() method!

  image

As the Math library includes both Methods and Fields (constants in this case) you would use GetMembers() instead.

   image

 

What else is in the VB library?

Do some browsing by typing “[Microsoft.VisualBasic.” and pressing Tab. When you find something interesting then add the closing square bracket and add .GetMembers() and see what’s there. For example, [Microsoft.VisualBasic.Constants] provides a list of constants like vbOK and vbCancel.

 

.

6/19/2016

Office 365 / SharePoint Online Site Contents Page Changes

 

SharePoint Online Latest Change of the Week / Day / Hour / Minute…

If you use Office 365 / SharePoint Online then you should now be used to the constant tinkering with the user interface. I’m starting to feel like SharePoint Online is kind of like the weather in Cincinnati… if you don’t like it, hang around, it will be different tomorrow.

One of the latest changes is to the Site Contents page. A preview of this page is documented in the link below. But… it’s already out of date! They have since added the Top Link bar back and the site icon. (To see these new pages in advance of general release you need to enable Preview Features in the tenant’s SharePoint Settings page.)

https://support.office.com/en-us/article/The-SharePoint-Site-Contents-page-ba495c1e-00f4-475d-97c7-b518d546566b?ui=en-US&rs=en-US&ad=US

 

The page as of 6/19/2016…

image

 

Changes to Site Contents:

  • This is a “New SharePoint” style page. It is responsive and will somewhat adapt to screen resolution and device size. But like the other new responsive pages, a change of screen resolutions or zoom levels will make well known navigation elements move to new locations, or disappear. (Usually being rolled up into another navigation element.)
    Where did Quick Launch go? (It’s now the three slashes button) Where did the App launcher/waffle button go? (It’s now changed colors and has moved to the right into the middle of the other buttons.)
    image
  • This is no longer a master page based page or even a typical ASPX page. Right-click the page, select View Source and you will see that there’s basically an empty HTML tag and the loading of a bunch of JavaScript. If you use the F12 developer tools in your browser you will see that everything’s a DIV and there are MANY JavaScript files being loaded. The page is still stored in “_layouts” so there’s no customization through web parts or SharePoint Designer.
  • +++ They changed the list of lists and libraries into a list!!! No more ugly blue squares, in no useful order and having to click Next, Next, Next.
    image
  • +++ The lists are sortable!!! (But not filterable or customizable. It would be really nice to group on list type or especially a custom property!)
  • +++ They also changed the list of subsites into a list!!! It’s also sortable!
    image
  • - - - They added new big ugly blocks that we have to scroll past to get to the list of lists and subsites. These are site activity reports that really should be in their own page somewhere, maybe a “Site Activity” page. The first two big tiles do link to their own report pages.
    image
  • - - - They gave the page a new “New” button that will confuse the heck out of people.
        image
    Click New and then List, you get a “Custom List”. No options. Click New and then Library, you get a generic library. If you want a Tasks list or an Announcements list, you have to click New and App. And then we are back to the ugly big blue tiles. (The New App page would be a great place to replace the blue tiles with a list! Give it two tabs, “Lists and Libraries” and “SharePoint Apps”.  Oops, I should have said “SharePoint Ad-ins”. They did tell us that they renamed these, right?)

 

So…

They cleaned up, and cluttered up, the Site Contents page.

 

Don’t like the new design… hang around!

(Today it’s hot and sunny in Cincinnati…)

 

.

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.