3/14/2014

History of File and BLOB Storage in SharePoint

 

You always find the most interesting things while looking for something else…

I just ran across an interesting white paper from Microsoft on Shredded Storage in SharePoint 2013. What made it really interesting is that is has a nice history of file storage in SharePoint, starting with the Web Storage System in SharePoint 2001 through Shredded Storage in 2013.

 

Overview of Shredded Storage in SharePoint 2013

Download it here: http://www.microsoft.com/en-us/download/details.aspx?id=39719

 

.

3/04/2014

Cincinnati PowerShell User Group 4/17/14 – SAPIEN Technologies

 

I just got the email below from Rob Dreyer of the Cincinnati PowerShell User Group. Cool stuff!

Mark your calendar! April 17th 2014 at MAX Technical Training in Mason, Ohio.

For more information and to register for the event (free!): http://www.meetup.com/TechLife-Cincinnati/events/154731982/ 


Hello Everyone,

I have some amazing news – our first meeting in 2014 will be extra special. Throughout 2014, Dr. Ferdinand Rios, the CEO of SAPIEN Technologies, Inc. is touring around the world. Last week, I received word that on Thursday April 17th he will be coming to MAX! I nearly fell out of my seat when I heard.

 

clip_image002clip_image004clip_image005clip_image007clip_image009

And, if you haven’t tried PrimalScript or PowerShell Studio, now is the time!

clip_image010

Check out the links below for more details. Thanks, Ferdinand!

Free Software Upgrades: http://www.sapien.com/blog/2014/02/13/2014-versions-out-march-15-buy-now-and-save/

Free PowerShell Training: http://www.sapien.com/blog/2013/12/23/sapiens-full-powershell-video-catalog-now-on-you-tube/

Let’s plan to give him a warm welcome. We’ll be hosting the event at MAX, but I will also provide remote access using GoToMeeting for those who cannot attend. I’ll send meeting information out as we get closer to the event. Hope to see you soon!

2/20/2014

Download a File from SharePoint using PowerShell

 

I recently had a request for a PowerShell script that could be run as a Windows scheduled task to download a file each night to a network share. As is typical, there's more than one way…

 

The PowerShell / .Net approach:

This is a ".Net approach" as it does not use any PowerShell cmdlets (beyond New-Object). The following will work from all versions of PowerShell and SharePoint 2007 – 2013, but not Office 365. It will work from any client PC as long as you have permissions to access the file. Why not Office 365? O365 requires an authentication cookie. (When I get some time I'll post an O365 version.)

$fromfile = "http://yourserver/sites/yoursite/shared%20documents/yourfile.xlsx"
$tofile   = "c:\somedirectory\yourfile.xlsx"

$webclient = New-Object System.Net.WebClient

$webclient.UseDefaultCredentials = $true
#  or
# $webclient.Credentials = …
$webclient.DownloadFile($fromfile, $tofile)

 

The SharePoint Approach:

This approach must be run from a SharePoint server and uses the Get-SPWeb cmdlet to access a site. As it is much more complicated, why would you ever use it? To do more complex things! Things like getting all of the files from a library and then downloading them (in a foreach loop), ZIPing the file(s) before download or otherwise manipulating the files before download.

The following will work from the SharePoint 2010 and 2013 Management Shells (but not for Office 365). Why not Office 365? The following needs to be run on the SharePoint server, and you are not allowed to do that with O365.

$fromsite = "http://yourserver/sites/yoursite"

$fromfile = "yourlibrary/yourfile.xlsx"
$tofile   = "c:\test\yourfile.xlsx"

$web = Get-SPWeb $fromsite
$file = $web.GetFile($fromfile)
$filebytes = $file.OpenBinary()

$filestream = New-Object System.IO.FileStream($tofile, "Create")
$binarywriter = New-Object System.IO.BinaryWriter($filestream)
$binarywriter.write($filebytes)
$binarywriter.Close()

 

.

2/17/2014

SharePoint 2013 and Office 365: Finding GUIDs

 

Years ago I wrote a little article on how to find SharePoint GUIDs for SharePoint 2007. Later I wrote one on how to find the same GUIDs using PowerShell.

Now, here's how to find GUIDs for just about anything using SharePoint 2013's REST web services! The following will work for both on premises and SharePoint Online / Office 365.

---

SharePoint 2013 includes a REST service to access sites, lists and items. In the data that's returned is an ID that is the GUID for the item.

Accessing REST is quite easy as you only need to type it into the address bar of your browser! REST does not work around security, so you will still need to authenticate to your site.

In the examples below "yourdomain" will of course be replaced with your domain name. If using Office 365 it might look like "http://companyname.sharepoint.com.

If you get a result that looks like this…

    image

… you can either use the View Source feature of the browser to see the XML or change the way the browser displays XML. For Internet Explorer:  Tools, Internet Options, Content tab, Feeds and Web Slices Settings and then uncheckmark "Turn on feed reading view",

 

Getting the GUID for your subsite (and a lot more…)

Visit your site, login and then edit your URL to look like this:

https://yourdomain.sharepoint.com/sites/yoursite/yoursubsite/_api/web

Scroll down to the content section and look for the ID element.

image

 

For other objects… sites, lists, items, fields, users…

See the references at the end of this article for even more examples.

The current site collection:
    /_api/Site

Web and Site Features and their GUIDs:
    /_api/web/Features
    /_api/site/Features

 

Lists:
    /_api/web/Lists

A single list (by name):
    /_api/web/Lists/getbytitle('tasks')

A single list (by GUID):
    /_api/web/Lists(guid'c61dc1a2-4982-4dc8-9d78-603d83d81940') (of course using your list's GUID!)

All list items:
    /_api/web/Lists/getbytitle('tasks')/items

A single list item:
    /_api/web/Lists/getbytitle('tasks')/items(12)   (Item with the ID of 12)

List items by criteria:
    /_api/web/Lists/getbytitle('tasks')/items?$filter=Status eq 'Not Started'

 

All list columns, including both display name and internal name!
    /_api/web/Lists/getbytitle('tasks')/Fields

Especially note these two elements:
    <d:InternalName>PercentComplete</d:InternalName>
    <d:Title>% Complete</d:Title>

The current user:
    /_api/web/CurrentUser (No GUID here, but there are other goodies!)

 

There's a lot more that you can do with SharePoint 2013's REST services!

.

1/31/2014

InfoPath 2013 is the last InfoPath!

 

InfoPath 2013 and InfoPath Forms Services in SharePoint 2013 are at the end of life…

See here: http://blogs.office.com/2014/01/31/update-on-infopath-and-sharepoint-forms/

Supported until 2023, but no new versions.

So what will you use for forms?

 

.

1/12/2014

Why use InfoPath?

 

Update 1/31/14: InfoPath 2013 is the last InfoPath!


 

I'm surprised how often people in my SharePoint end user and developer classes don't know what InfoPath is, or if they do, where it can be used in SharePoint. Any discussion of InfoPath leads to a discussion of the future of InfoPath and if it is going away, what the alternatives are. What follows are some of my class notes…

A brief history of InfoPath

  • Formally named XDocs and NetDocs (*)
  • A patented way of authoring XML using DHTML views and XSLT (*)
  • Released in 2003 as part of Microsoft Office Professional 2003
  • Versions: 2003, 2007, 2010, 2013 (matching the releases of Office)
  • Started getting a lot of attention with the release of InfoPath Forms Services with the Enterprise Edition of MOSS 2007

 

InfoPath can be used:

  • To create custom stand alone forms. InfoPath templates can used as library or Content Type templates. When the user submits the form the data can be saved back to a SharePoint library as an XML file or to other destinations such as email or network shares. In SharePoint, saved data is often then processed using workflows to approve the content or to use the data to update other lists or external systems. (The XML format is easy for developers to work with.)
  • To create custom forms for lists. These forms save their data back into a SharePoint list, not as an XML file, but as a list item with the data saved as item properties/columns.
  • To create workflow forms in both SharePoint Designer and Visual Studio workflows. (But SharePoint 2013 workflows only create ASPX forms.)

 

Reasons to use InfoPath:

  • Rich editor to create a form that can look like anything you want.
  • Rules based business logic to hide, show, format and validate fields.
  • External connectivity to offer dropdown lists populated from SharePoint lists, SQL server and many other sources.
  • While a forms designer needs a licensed copy of InfoPath, the end user only needs a web browser. Users do not need any InfoPath product or version if the forms are hosted in the Enterprise Edition of SharePoint 2007, 2010 or 2013.
  • Lots of resources are available: classes, books, blog articles, videos
  • No knowledge of JavaScript, jQuery, XML HTML or CSS needed to create custom forms and custom validation.
  • Multiple views of data. Example: A user might see 50 fields when filling out the form. The approvers might see a 10 field summary and after approval or rejection the user might only see 2 fields and a comments field.
  • Optional bidirectional data (edit a property in the InfoPath form and it updates in the library metadata, edit library metadata and it updates in the InfoPath form - great for workflows!)

 

Reasons not to use InfoPath

  • Yet another tool to learn
  • Unknown future - InfoPath 2013 is largely unchanged from 2010 and SharePoint Designer 2013 workflows only create ASPX forms.
  • There are 3rd party solutions for forms design in SharePoint
  • You must have the Enterprise Edition of SharePoint, otherwise every user must own InfoPath

 

Benefits unique to developers:

  • Much less work to create Initiation, Association and Task forms for Visual Studio workflows
  • Much less work to customize SharePoint Designer workflow forms
  • Everything is XML!
  • No JavaScript, HTML, etc...

 

Disadvantages to developers:

  • We like to write code!
  • There's always something that we want to do that InfoPath can't do but we can do by writing more code.
  • Yet another tool to learn.
  • There's always a better tool somewhere.
  • Need to buy at least one copy of InfoPath.

 

Interesting comments by others…

Andrew Connell says "I do not use InfoPath any more & I do not recommend people use InfoPath going forward." http://www.andrewconnell.com/blog/my-thoughts-infopath-2013-the-future-of-infopath Read all of the comments!

The Office SharePoint blog: "InfoPath is our integrated forms solution for the foreseeable future"
Options to Create Forms in SharePoint 2013 http://blogs.office.com/b/sharepoint/archive/2013/03/04/options-to-create-forms-in-sharepoint-2013.aspx 

MSDN: "In this release, InfoPath 2013 has not introduced new functionality or scenarios."
http://msdn.microsoft.com/en-us/library/office/jj229830.aspx#odc_off15_ta_WhatsNewforO15Developers_InfoPath 

Glen Furnas at sharepoint-community.net: "Simply put, InfoPath is a multi-purpose product that’s been put to use in a wide variety of ways, and no single alternative will ever replace it in all its roles."
http://sharepoint-community.net/profiles/blogs/alternatives-to-infopath-exploring-the-options

Owen Runnals: "In the end I feel custom ASPX pages are the safest bet since they've worked since SharePoint 2007."
http://owenrunnals.blogspot.com/2013/01/the-future-of-custom-forms-in.html

 

Alternatives to InfoPath?

ASPX Forms

maybe Microsoft LightSwitch: http://msdn.microsoft.com/en-us/library/vstudio/jj969620.aspx

Microsoft Access 2013 / Access Apps (but no workflow support)

Nintex Forms: http://www.nintex.com/en-US/Products/Pages/NintexForms.aspx

K2 smartforms: http://www.k2.com/platform/formshttp://www.k2.com/blog/k2-smartforms-vs-microsoft-infopath

.

1/02/2014

SharePoint Classes at MAX Technical Training

 

As you probably know, I'm a senior instructor at MAX Technical Training. As I'm starting my ninth year at MAX this week I thought I should plug a few of my upcoming classes!

You can attend these classes at our Cincinnati area training facility in Mason Ohio or attend remotely from anywhere in the world.

SharePoint 2010 Development

MS-10175 Developing and Customizing Applications for MS SharePoint 2010 (aligns with exam 70-573)
January 6-10

 

Do you have a governance plan? A real governance plan?
MA-1040 SharePoint Governance, Planning and Oversight (one of my favorite topics and one I often present on at SharePoint events.)
January 16-17

 

Are you ready for SharePoint 2013 development?

MS-20488 Developing Microsoft SharePoint Server 2013 Core Solutions (aligns with exam 70-488)
February 10-14

MS-20489 Developing Microsoft SharePoint Server 2013 Advanced Solutions (aligns with exam 70-489)
January 27-31

If you are interested in SharePoint 2013 Developer Certification then you will also need exams 70-480 and 70-486…

MS-20480 Programming in HTML5 with JavaScript and CSS3 (aligns with exam 70-480)
January 20-24

MS-20486 Developing ASP.NET MVC 4 Web Applications (aligns with exam 70-486)
February 17-21

When you register… tell'm that Mike sent you and you might get an extra donut or something Smile

12/29/2013

Is VB.Net dead?

 

Just a random thought at the start of a new year… Is VB.Net dead? Deprecated? Just not interesting to Microsoft Learning?

It seems the newer 204** series Microsoft MOC classes only cover C# (and JS / HTML5). I've also been reading that C# is the only language option in most of the newer certification exams.

On the other hand, it looks like Visual Studio is still treating VB as an equal to C#. There are no new VB and C# language features in VS 2013, but VB is still there. The VB team blog says "We are actively working on the next versions of Visual Basic and C#" (*).

What about VBScript? As of Internet Explorer 11, VBScript is considered deprecated. (MSDN article)

This will be entertaining to watch as many of my web and SharePoint class attendees are still working in VB shops!

Mike

10/23/2013

Add a SharePoint "New" icon anywhere!

 

Would you like to flag a paragraph or an item in a bulleted list on your home page as "new" and then have the new flag disappear after a certain date? While it would be nice if we could reuse the new item functionality found in SharePoint lists and libraries, we will have to write our own. As we want to keep this as simple as possible we will add the expire date as the image's "Alternate text" attribute, which is easy to do while inserting images into a page.

In a nut shell, the basic steps for your users are:

  1. Edit the page or the web part
  2. Insert the NewFlag.jpg image (you will need to tell them the location or the URL)
  3. Add the expire date as MM/DD/YYYY as the "Alternate Text"

Step 1 – get an image

You can't just use the SharePoint New icon as it is stored as a sprite and not a simple image. We could use a SPAN tag, an IMG tag and a CSS class, but that's too much HTML for our site owners to add each time they want to flag something as new. So we need to find or create an image… you can draw your own in Windows Paint or you could capture the image from a SharePoint page.

Capture the image:

  1. Add a new item to a list or library (so we can see the New icon)
  2. Capture the current screen  (press PrtSc on your keyboard or use a screen capture tool)
  3. Open Windows Paint and paste the screen capture
  4. Use the Select tool and select just the New icon
       image         image(for 2013)         image (for 2010)
  5. In the Paint Home ribbon click Crop and then save the file as NewFlag.jpg
  6. Upload this file to a SharePoint library such as Site Assets, or if you have access to the server, upload the file to c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\Template\Images   (use 12 for 2007, 14 for 2010 and 15 for 2013)

Step 2 – add some JavaScript to the master page

  1. Open your site in SharePoint Designer (2007 for SP 2007, 2010 for SP 2010, etc.)
  2. Find and edit your master page (default.master for 2007, v4.master for 2010 and seattle.master for 2013 – note that the your master may be different!)
  3. Scroll to the end of the master page and find the </body> tag
  4. Add the JavaScript from below, depending on the version, just in front of the </body> tag
  5. Save your master page

Step 3 – test it

  1. Go to the home page of a test site and edit the page
    • for 2010 and 2013 home pages: Site Actions, Edit Page
    • for 2007 basic pages: Site Actions, Edit Page
    • for all web part pages: add a Content Editor Web Part and get it in text edit mode
  2. Add the new text   ("Free laptops until Tuesday!")
  3. 2013
    • Insert the NewFlag.jpg image from wherever you uploaded it next to the new text
      image
    • Set the Alt text to the expire date (i.e. 12/24/2013)
      image
  4. 2010
    • Insert the NewFlag.jpg image and add the expire date as the Alternative Text:
      image
      image
    • For testing, add one image with past date and one with a future date.

      image
  5. Save your changes – expired "new item" flags should now disappear

 

 

The JavaScript code:

For 2007 and 2010

<script type="text/javascript">
// TechTrainingNotes.blogspot.com

function TTNNewFlags()
{
  var TTNimgs = document.getElementsByTagName("img");
  for (var i=0; i<TTNimgs.length; i++)
  {
   if (TTNimgs[i].src)
   {
    if (TTNimgs[i].src.indexOf("NewFlag")>-1)
    {
       var TTNflagdate = new Date(TTNimgs[i].alt);
       if (TTNflagdate < new Date())
       {
         TTNimgs[i].style.display="none";
       }
    }
   }
  }
}

// for 2007 and 2010
_spBodyOnLoadFunctionNames.push("TTNNewFlags()");


</script>

 

For 2013

<script type="text/javascript">
// TechTrainingNotes.blogspot.com

function TTNNewFlags()
{
  var TTNimgs = document.getElementsByTagName("img");
  for (var i=0; i<TTNimgs.length; i++)
  {
   if (TTNimgs[i].src)
   {
    if (TTNimgs[i].src.indexOf("NewFlag")>-1)
    {
       var TTNflagdate = new Date(TTNimgs[i].alt);
       if (TTNflagdate < new Date())
       {
         TTNimgs[i].style.display="none";
       }
    }
   }
  }
}

// for 2013
ExecuteOrDelayUntilScriptLoaded(function () {
      if (typeof asyncDeltaManager != "undefined")
        asyncDeltaManager.add_endRequest(TTNNewFlags);
      else TTNNewFlags();
  }, "start.js");


</script>

Thanks to Daniel Laksana for his tip for delayed load of JavaScript in SP 2013: http://blog.symprogress.com/2013/09/sharepoint-2013-execute-javascript-function-after-mds-load/

 

.

10/21/2013

Cincinnati SharePoint User Group 10/24/13

 

I'll be speaking at the Cincinnati User Group this Thursday, 10/24/13. See you there!


The Cincinnati SharePoint User Group will now be meeting on the 4th Thursday of each month. The next meeting is 10/24/2013. Same location and same time, just a different day!

Speaker: Mike Smith

MVP SharePoint, Senior instructor at MAX Technical Training, Computer professional (computer nut) since 1980, Courseware author, Book author (SharePoint 2007 & 2010 Customization for the Site Owner), Speaker at SharePoint events, toy airplane pilot..

Topic: Using PowerShell, and a web service call or two, to Administer SharePoint Office 365

In this presentation we will combine the recently released SharePoint Online Management Shell PowerShell module, the Microsoft Online Services PowerShell module and a few PowerShell web services calls to management SharePoint Online. By the end of the session we will have a complete script to create a SharePoint classroom or team collaboration environment in the cloud!

We will use the Microsoft Online Services to add users, passwords and manage licenses.

We will use the SharePoint Online Management Shell to create Site Collections, add users and add groups.

We will use web services to create subsites, lists and libraries.

And of course... there will be food, door prizes and networking!

http://www.CincinnatiSPUG.org

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.