9/20/2015

SharePoint Saturday Cincinnati… Boo!

If you don't put this in your calendar right now… ScarePoint Saturday is going to sneak right past you!

image

SharePoint Saturday Cincinnati is a FREE one day conference. The event is open to the public and is your FREE chance to immerse yourself in the SharePoint platform! Saturday October 10th , 2015 8am-6pm.

FREE one day event

Come learn from the
SharePoint EXPERTS

Register Online http://bit.ly/1DAprtv

Sponsor Raffle & Prizes following
Event

Follow us on Twitter
@spscincinnati  #spscincy

SharePoint Saturday Cincinnati is dedicated to educating and engaging members of the local SharePoint community. SharePoint Saturday Cincinnati draws upon the expertise of local and international SharePoint IT professionals, business experts, developers, architects, and users who donate their time to share real world experiences, lessons learned, best practices and general knowledge with fellow SharePoint enthusiasts.

Speakers: Ajay Iyer, Bill Crider, Brian T. Jackett, Chris McNulty, Daniel Glenn, Gina Montgomery, Heather Newman, Ivan Sanders, JD Wade, John Ramminger, Liz Sundet, Mark Rackley, Michelle Caldwell, Mike Smith, Patrick Tucker, Paul Stork, Ricardo Wilkins, Robert Bogue, Roger Sears, Ryan Dennis, Scott Brewster, Sean McDonough, Seb Matthews, Shila Nagarsenker, Simeon Cathey, Toby McGrail

SHARONVILLE CONVENTION CENTER
11355 Chester Rd, Cincinnati, OH 45246
http://www.spsevents.org/city/cinci/cinci2015/home
October 10th , 2015 8am-6pm

 

A big THANK YOU to all our Sponsors. Without you this event would not be possible.
http://www.spsevents.org/city/cinci/cinci2015/sponsors

image

 

 

.

Upload a File to SharePoint Using PowerShell

 

A while back I posted an article on downloading files from SharePoint using PowerShell (see here) that generated a few questions about uploading files. So… here's a few uploading scripts. Don't stop here though, there are many other examples on the web. Google/Bing is your friend!

 

An Upload with Metadata Script

This script not only uploads files, but lets you add metadata.

# Set a few variables
$file = "C:\test\myTestFile.txt"
$TTNwebUrl = "http://server/sites/yoursite"
$library = "Team Documents"
$overWriteExisting = $True #or add new version if versioning enabled

# do a little SharePoint setup
$web = Get-SPWeb $TTNwebUrl
$files = $web.GetFolder($library).Files
$fileNameForLibrary = $file.Substring($file.LastIndexOf("\")+1) 

# read the file
$data = Get-ChildItem $file

# add any needed metadata
$metadata = @{ "Project ID" = "A-200"; "Region" = "North" }

# or if no metadata needed: $metadata = @{}

# do the upload (the following is one line)
$newfile = $files.Add($library + "/" + $fileNameForLibrary, $data.OpenRead(), $metadata, $overWriteExisting)

 

And if you are a "one liner" PowerShell scripter:

(Get-SPWeb "http://server/sites/yoursite").GetFolder("Team Documents").Files.Add("Team Documents/myTestFile.txt", (Get-ChildItem "C:\test\myTestFile.txt").OpenRead(), $True)

And with metadata:
(Get-SPWeb "http://server/sites/yoursite").GetFolder("Team Documents").Files.Add("Team Documents/myTestFile.txt", (Get-ChildItem "C:\test\myTestFile.txt").OpenRead(), @{ "Project ID" = "A-200"; "Region" = "North" }, $True)

 

Upload an Attachment with a New List Item

I generally recommend linking from a list item to a file in a library, but if you want to add attachments to a list item, here's a sample script:

# Set a few variables
  $TTNweb = Get-SPWeb "http://yourServer/sites/yourSite";
  $list = $TTNweb.lists["yourListName"];
  $filePath = "C:\SampleDocs\yourSampleFile.JPG";

# Create a new list item:
  $item = $list.items.Add(); 
  $item["Title"] = "Test Title";
  # set any addition metadata 
  $item.Update();

# Upload the file:
  $bytes = [System.IO.File]::ReadAllBytes($filePath);
  $item.Attachments.Add([System.IO.Path]::GetFileName($filePath), $bytes);
  $item.Update();

 

 

Looking for a PowerShell course for SharePoint administrators and auditors?

SharePoint 2010 and 2013 Auditing and Site Content Administration using PowerShell

https://www.microsoft.com/en-us/learning/course.aspx?cid=55095A

Or you can attend my class in Cincinnati (locally or remotely)!
http://www.maxtrain.com/Classes/ClassInfo.aspx?Id=119394

.

9/08/2015

New SharePoint 2013 Search for Power Users Class

 

I'm very pleased to announce my latest Courseware Marketplace course! 55141AC SharePoint 2013 Search for Power Users. While the class has not shown up yet on the Microsoft Learning site, it should be here shortly. MCTs can download it today at https://shop.courseware-marketplace.com. You can attend it soon at Microsoft training centers around the world.

If you can't find the class near you, you can attend the class in Cincinnati or remotely at MAX.

SharePoint Search Class 1200

 

Oh, don't forget the administrators! We have a SharePoint 2013 search class just for them: 55122AC Microsoft SharePoint 2013 Search Administration. If you can't find the class near you, you can attend the class in Cincinnati or remotely at MAX.

SharePoint-Search-Class-Administrator-1200

 

.

8/18/2015

Cincinnati PowerShell User Group Meeting

 

Register here: (free!) http://www.meetup.com/TechLife-Cincinnati/events/224705451/

Cincinnati PowerShell Users group – August Meeting

When: August 27th
Where: Max Technical Training
Mason, OH

PS C:\> Get-PSUG | where {$_.City -eq Cincinnati}

The Cincinnati PowerShell user group is back and under new management!  Last meeting was great with Ed Wilson as our presenter, I hope you all got as fired up about scripting as we did!

Come join us as we dive into….

Version Control?  That's for Developers, not Admins!!

Does your version control look like this?!?!?

We'll cover different ways to approach source control with PowerShell, why we as System Administrators need it, and why the idea of "infrastructure-as-code" is getting so much traction these days.

 

Sponsor!

SAPIEN Technologies will be sponsoring the Cincinnati PowerShell User Group meeting and will be supplying the pizza!

.

8/16/2015

They just can't leave anything alone! "App" now is "Add-in"???

 

Just as they have gotten everyone to call everything an "app", they have to change it again. Lists = apps, libraries = apps, web parts = app parts… everything was to be an app. Now everything is a "add-in"?

  • "SharePoint apps" are not SharePoint Add-ins.
  • "SharePoint app parts" are now "SharePoint add-in parts"

But strangely…

  • The SharePoint "app launcher" and the "My Apps" page are keeping their old names.

 

Everybody say "Add-In"! Smile

https://msdn.microsoft.com/EN-US/library/office/fp179930.aspx

The name "apps for SharePoint" is changing to "SharePoint Add-ins". During the transition, the documentation and the UI of some SharePoint products and Visual Studio tools might still use the term "apps for SharePoint".

Also see:  https://msdn.microsoft.com/EN-US/library/office/fp161507.aspx#bk_newname

 

 

So… what is an "App"?

List? Libraries?  Not too sure anymore…

Oh well…

.

8/07/2015

Hiding the Evil SharePoint 2013 Share Buttons!

 

SharePoint introduced Share buttons to make it easy for users to quickly share a site, folder or document. This introduced several administration, security and governance problems for administrators. Mostly because the act of sharing a document breaks inheritance on the file. Whether this is "evil" or not depends on the way you need to use SharePoint. 

Here's a sample flow:

  • We have a library for 100 sales documents. Currently the Sales Managers group and five other users have access to the library and its contents.
  • Someone clicks the Share button on a document.
    • If the user is not an owner and does not have the Manage Lists permission, then a request is added to the Site Owners. Site Owners, if they ever discover the request, can approve or reject it.
  • Inheritance is broken on the document. Existing permissions are copied to the file. The user is added to the document's permissions list.
  • Now the fun begins…
    • A new user or group is given permissions to the library.
    • They only see 99 documents! (The missing document has unique permissions and no longer inherits permissions from the library.)

After inheritance is broken you have to remember to manage the permissions of each individual broken inheritance document. Now think about 50 libraries, each with where the Share button has been clicked on a 1000 documents. Job security at the minimum!

 

Just how many Share buttons are there?  
(Let me count the ways…)

The Share the site button:

   image

The Share a document button in the "QCB" (Quick Control Block?) bar:

   image

The Share a document button in the FILES ribbon :

   image

The Share a document button in the "…" pop out:

   image

The Share a document link in the "… …" menu:

   image

The INVITE PEOPLE button in create a new folder:

   image

The Invite People button in the Shared With dialog box:

   image

Did I miss any?

(I started on this article a few times, but each time I found yet another Share button!)

 

Disabling using Views

You can hide the Share button that's just above the library by switching to any other view style than"Default". This also hides all of the other links in the "QCB" (Quick Control Block?) bar.

image

The Share button will be grayed out in the FILE ribbon if you select a Style other than Default and Shaded, or disable "Tabular View - Allow individual item checkboxes".

Disadvantages? These styles do not display a checkbox, even if "Tabular View - Allow individual item checkboxes" is checked. Without the checkbox most of the options in the FILE ribbon are disabled.And… this approach only hides one of the Share buttons.

 

Disabling the Share buttons using CSS

The easiest way, at least until Microsoft gives us an option to turn them off, is to add CSS to the Master Page. Some of the buttons has convenient IDs while some can be found using a class. While you could merge all of the selectors into one line, I broke them out so you could choose which Share features you would like to hide or keep.

In my project I uploaded the CSS file to the Site Assets library. You could place the CSS file in any library where your users have at least read access, or in the layouts folder on the server. You would then link to the file something like this:

<link rel="stylesheet" type="text/css" 
href="https://yourServer/sites/yourSite/SiteAssets/nosharebuttons.css"></link>

Or maybe:

<link rel="stylesheet" type="text/css" href="/_layouts/nosharebuttons.css"></link>

 

The CSS:

/* CSS to hide the various Share buttons and links */
/* from TechTrainingNotes.blogspot.com             */
/* Use at your own risk. Batteries not included.   */

/* Hide Site Share button (page top right) */
#ctl00_site_share_button  {
 display:none !important;
}

/* Hide library toolbar (QCB) Share button */
.js-listview-qcbShareButton {
 display:none !important;
}

/* Hide the Share in the ... popout */
.js-callout-actionsMain span:nth-child(2) {
    display:none !important;
}


/* Hide the Share in the ... ... menu */
a[title="Share"] {
 display:none !important;
}


/* Hide the INVITE PEOPLE button in Create Folder */
#csfd_invitePeopleBtn {
 display:none !important;
}

/* Hide the Share button in the FILES ribbon */
#Ribbon\.Documents\.Share\.ShareItem-Large {
 display:none !important;
}

/* Hide the Invite People button in the Shared With dialog */
#lnkShrItem {
 display:none !important;
}

 

Here's the "one line" version:

/* CSS to hide the various Share buttons and links */
/* from TechTrainingNotes.blogspot.com             */
/* Use at your own risk. Batteries not included.   */


#ctl00_site_share_button, 
  .js-listview-qcbShareButton, 
  .js-callout-actionsMain span:nth-child(2), 
  a[title="Share"], 
  #csfd_invitePeopleBtn, 
  #Ribbon\.Documents\.Share\.ShareItem-Large, 
  #lnkShrItem 
{
 display:none !important;
}

 

.

7/13/2015

SharePoint 2013: Center or Centre? Search knows the US/UK spelling variations!

 

Weird what you stumble across in SharePoint! There is no end to finding things!

Center or Centre? Organization or Organisation? Harbor or Harbour?

SharePoint 2013 search, both On Prem and Office 365, appears to have a US/UK synonym list built-in. I can't find documentation for it anywhere, but it seems to work as expected. Below a few of the words I tested. Search for one and you will find documents with the other.

  • center/centre
  • neighbor/neighbour
  • organization/organisation
  • color/colour
  • flavor/flabour
  • honor/honour
  • caliber/calibre
  • practice/practise
  • license/licence
  • defense/defence
  • connection/connexion
  • realize/realise
  • spelled/spelt
  • analyze/analyse

My editor's spell checker marks all but one of the second terms as misspelled! It seems to like "spelt".

To see a list of these common spelling variations see https://en.wikipedia.org/wiki/American_and_British_English_spelling_differences

 

.

7/09/2015

SharePoint 2013: Hide List and Library Column Headings

 

This is an update to an older article to include support for SharePoint 2013.


Hiding Column Headings

I had a request to hide the column headings of a list displayed in a web part. First thought was that they wanted to hide the toolbar, but they were asking about the clickable column headings. I think they were wanting to make a page look more like a regular web page instead a page full of lists. By the way, this makes for a better way to display a view with only one column.

Note: This will of course remove the ability of the site visitor to sort and filter the web part.

Note: This will also work in the view page (view pages use web parts!), but in SharePoint 2010 and 2013 adding a web part to a view page will change how the ribbon gets displayed and will remove the View dropdown menu from the title area crumb trail.

Before:

image

After:

image

With Toolbar set to "No Toolbar":

image

Remove additional clutter…

You can edit the web part and then click "Edit the current view" further clean up the display of the list.

  • Remove the checkbox column: In the Tabular View section uncheck "Allow individual item checkboxes".
  • Remove the "…": In the Columns section uncheck "Name (linked to document with edit menu)" and checkmark "Name (linked to document)".
  • Remove the hyperlink: In the Columns section uncheck "Name (linked to document with edit menu)" and checkmark "Name (for use in forms)".
  • Remove any unneeded columns such as Modified or Modified By.

image

 

Steps:

  • Add your web part for the list or library to a page.
  • For a minimal look set the web part's Toolbar Type property to “No Toolbar”.
  • Copy the JavaScript below to a Notepad file (name it something like “HideHeading.html”) and upload this file to a library such as Site Assets.
  • In the library where you uploaded this file, click the "…" and copy the displayed URL. It should look something like this:
        https://yourServerDomain/sites/training/SiteAssets/HideColumnHeadings.html
  • Below your list / library web part add a Content Editor Web Part (CEWP).
    • If the CEWP displays it’s title bar then in the Appearance section set the Chrome to “none”.
    • Paste the URL copied above into the Content Link box.
    • In the web part properties editor, click OK.
    • In the PAGE ribbon, click Save.
  • Or (for SharePoint view pages)
    • Edit the view page in SharePoint Designer 2013. 
    • Copy and paste the Javascript to just before the end tag for PlaceHolderMain (just before </asp:Content>).
  • If you want to hide the column headings of multiple web parts modify the IF statement like this Three web parts

Web part summary name!

In SharePoint 2007, the summary name is usually just the list’s name: “Shared Documents”.

In SharePoint 2010, the summary name is usually the list’s name PLUS the list’s description. For example the default for Shared Documents is: “Shared Documents Share a document with the team by adding it to this document library.”  (including the period)

To find the correct name use your browser’s View Source option to display the HTML of the page and search for “summary=” and copy the text that follows. Or, use the browser's developer tools (usually F12) and search for "summary="

    <table  …  summary="Shared Documents Share a document with the team by adding it to this document library."   … >

 

The JavaScript

Need to change multiple web parts? Edit the line that contains "if (x[i].summary==""

Two web parts:
             if (x[i].summary=="Tasks" | x[i].summary=="Shared Documents"
Three web parts:
             if (x[i].summary=="Tasks" | x[i].summary=="Links" | x[i].summary=="Shared Documents"

<script type="text/javascript">
// CEWP trick from techtrainingnotes.blogspot.com!

// techtrainingnotes.blogspot.com/2015/07/sharepoint-hide-list-and-library-column.html
// Hide column headings in web parts

function TTNHideHeadings()
{
  //Find the list  (change "Documents" to your web part's "summary" name)
  var x = document.getElementsByTagName("TABLE"); // find all of the Tables 
  var y;
  for (var i=0;i<x.length;i++) 
  {
    if (x[i].summary=="Documents")  //find the table with this name
    {
      y = x[i].getElementsByTagName("TR");
      y[0].style.display="none";  //hide the first row
    } 
  }
}

try {
  // for 2010 and 2013
  ExecuteOrDelayUntilScriptLoaded( TTNHideHeadings, "sp.js" );
}
catch (e) {
  // for 2007
  _spBodyOnLoadFunctionNames.push('TTNHideHeadings');
}
  
</script>

7/06/2015

Using SharePoint Search To Find Sites You Have Access To


Did you ever wonder if there's more to SharePoint? Sites you may have permissions to, but no one ever told you about? Sites like the rumored jokes site and the "free stuff" site? You can use search to find these sites!
ContentClass is a SharePoint 2013 Managed Property that is used to find many SharePoint things by their "type". Two ContentClass values of interest when searching for sites are "STS_Site" and "STS_Web".
Tip: For more on what you can do with ContentClass see SharePoint Power Searching Using ContentClass and also here: http://techtrainingnotes.blogspot.com/2015/02/sharepoint-2013-list-and-library.html

STS_Site

The STS_Site property is used to find site collections, or actually just find the top level sites of site collections. To list all of the top level sites that you have permissions to see, search for "ContentClass:STS_Site". (See warning below!)
image
My test user Sam found 8 site collections and my administrator account found 38.

STS_Web

The STS_Web property is used to find subsites. To list all of the subsites that you have permissions to see, search for "ContentClass:STS_Site". (See warning below!)
image
Sam found 9 subsites while my administrator account found 158.

Find all sites you have access to…

Just combine both searches with an "OR" to show all of the sites you have access to. (Remember that Boolean operators like AND, OR and NOT must be in UPPER case.)
image

Adding Keywords

A little tip: If you add keyword to your STS_Web and STS_Site queries you will not be searching content in the site. You instead will be searching for that keyword as a property of the home page or content that might be displayed on the home page. The following search will only return results when "plane" in somewhere on the home page of the site:
image

Warn'n matey, here be dragons, or at least duplicates…

SharePoint 2013 search hides duplicates by default and treats many of the things returned by STS_Site and STS_Web as duplicates. Over half of my subsites are missing using an out of the box search! Administrators can fix this little issue by following the "Option 2" steps here: http://techtrainingnotes.blogspot.com/2015/04/sharepoint-2013-search-weirdness-part-1.html.

STS_Site <> SPSite

A note to developers and administrators: SPS_Site is not the same as SPSite. It's actually finding SPWebs, but only finding those that are top level webs.

.

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.