Showing posts with label SharePoint Administration. Show all posts
Showing posts with label SharePoint Administration. Show all posts

3/11/2016

New SharePoint 2016 Courses Coming from Microsoft

 

Microsoft is releasing two new SharePoint 2016 administrator courses in July. The courses have a new numbering scheme to better reflect the “Part 1” and “Part 2” nature of the pair. 20339-1 and 20339-2. While the focus is on on-premises SharePoint 2016, some Office 365 content is included.

Course 20339-1: Planning and Administering SharePoint 2016
https://www.microsoft.com/en-sg/learning/course.aspx?cid=20339-1
Publish date: July 8, 2016

Course 20339-2: Advanced Technologies of SharePoint 2016
https://www.microsoft.com/en-sg/learning/course.aspx?cid=20339-2
Publish date: July 21, 2016

.

3/08/2016

SharePoint PowerShell Training for Auditing and Site Content Administration

 

image

If you have followed this blog, you know that I’m kind of a SharePoint nut who’s also a PowerShell nut. Over the years I have created a lot of PowerShell scripts while working with SharePoint and answering questions in my classes and in the TechNet forums. There’s plenty of resources for installing and configuring SharePoint using PowerShell, but there’s little on dealing with all of the daily questions on premise admins get that can be quickly answered using PowerShell. I was just going to take my 100+ scripts and create something like a “cookbook”, but instead created a class. The class handout kind of ended up as the cookbook… 85 pages and 175 sample scripts, or maybe more like a giant PowerShell cheatsheet for SharePoint.

This class is for on-premise SharePoint 2010, 2013 and 2016 administrators. A SharePoint Online version is in the works, but not available yet.

If you would like to attend this class, delivered by the author (your’s turely!), we are offering it next Monday, March 14th, at MAX Technical Training in Cincinnati, Ohio. You can attend this class at MAX or remotely from anywhere. If you can’t attend this class, it is available from trainging centers all over the world.

March 14th class at MAX: SharePoint 2010 and 2013 Auditing and Site Content Administration using PowerShell

Search for this class at other training centers: https://www.bing.com/search?q=55095%20powershell

If you would like to see some of the other courses and books I’ve written, then click here.

 

55095 SharePoint 2010 and 2013 Auditing and Site Content Administration using PowerShell

This one day instructor-led class is designed for SharePoint 2010 and 2013 server administrators and auditors who need to query just about anything in SharePoint. The class handout is effectively a cheat sheet with over 175 PowerShell scripts plus the general patterns to create your own scripts. These scripts cover:

  • using the SharePoint Management Shell and the ISE
  • general tips for counting, reformatting and exporting results;
  • drilling up and down the SharePoint object model
  • getting lists / inventories of servers, services web applications, sites, webs, lists, libraries, items, fields, content types, users and much more
  • finding lists by template type, content type and types of content
  • finding files by user, content type, file extension, checked out status, size and age
  • finding inactive sites
  • finding and changing SharePoint Designer settings and finding and resetting customized pages
  • inventorying and managing features
  • deleting and recycling files and list items
  • inventorying users and user permissions and finding out “who can access what”
  • creating sites, lists and libraries
  • uploading and downloading files
  • and much more…

At Course Completion

After completing this course, students will be able to:

  • Use PowerShell to query just about anything inside of SharePoint.
  • Understand the core SharePoint object model and object hierarchy as seen from PowerShell.
  • Format PowerShell output in to reports.
  • Manage resources to limit the impact on production servers.
  • Create and delete Site Collections, subsites, lists, libraries and content.

Prerequisites

Before attending this course, students must:

  • Very good knowledge of SharePoint and its features.
  • Good experience using PowerShell 2 or later or recent completion of a PowerShell class such as 10961 or 50414.

Course Outline

Module 1:  SharePoint and PowerShell

This module provides an introduction to the topics covered in the class, introduces SharePoint PowerShell terminology and provides a review of important PowerShell features.

Lessons:

  • History of PowerShell in SharePoint
  • PowerShell vs. Search
  • PowerShell, SharePoint Management Shell and cmdlets
  • Security and Permissions Needed
  • Getting Started with PowerShell: Counting Items, Custom Columns, Reformatting Numbers, Saving Results to a File
  • Changing and Updating Content: Creating SharePoint Objects, Changing Objects

Lab:

  • Using PowerShell with SharePoint

After completing this module, students will be able to:

  • Get started using PowerShell to inventory and update SharePoint.

Module 2: Working with SharePoint CMDLETs and Objects

This module introduces the SharePoint object model and some important terminology.

Lessons:

  • GUIDs
  • Sites vs. Webs
  • The SharePoint Object Hierarchy

Lab:

  • Get a list of all Site Collections and their GUIDs
  • Get a list of all Webs in all Site Collections
  • Given a web’s URL get its parent web and web application

After completing this module, students will be able to:

  • Explore sites and webs using PowerShell.
  • Retrieve important properties of common SharePoint objects

Module 3: Managing Memory and Limiting Performance Impact

This explores limiting impact on server memory usage and performance.

Lessons:

  • Memory Management and Disposing Objects
  • Limiting Impact on Production Servers

Lab:

  • Exploring PowerShell’s use of system memory.
  • Testing the impact of scripts on server performance

After completing this module, students will be able to:

  • Recognize and manage the impact of PowerShell on a SharePoint server.

Module 4: Working with Content

This module explores SharePoint using PowerShell from the Farm down to individual list items.

Lessons:

  • Getting Farm Information: version, services, services, features
  • Getting Web Application information
  • Exploring Site Collections: retrieve Site Collections, Site Collection Administrators, quotas
  • Working with the Recycle Bins: finding items, getting file counts and bytes, deleted sites
  • Exploring Webs: web templates, finding webs, finding webs based on template, Quick Launch and Top Link Bar navigation
  • Exploring Lists and Libraries: finding all lists, lists by type, lists by Content Type, columns/fields, document count by web or library
  • Exploring Content Types
  • Finding documents: by a word in the title, file type, content type, size, date age, checked out status, approval status and many more…
  • Deleting content
  • Downloading and uploading files

Lab:

  • Explore the farm.
  • Inventory site collections.
  • Create a recycle bin report.
  • Finding all blog sites.
  • Find all picture libraries.
  • Find all PDF files over 5 MB.
  • Delete all videos in a site collection.

After completing this module, students will be able to:

  • Explorer, inventory and maintain SharePoint content using PowerShell.

Module 5: Users and Security

This module covers the use of PowerShell to explore and document SharePoint permissions.

Lessons:

  • Users: find a user, get a list of all users, working with Active Directory groups
  • SharePoint groups: Get lists of groups, get the members of a group, find all groups a user belongs to, find the groups associated with a web
  • Expanding users lists that include Active Directory groups
  • Documenting Broken Inheritance / Unique Permissions: webs, lists, libraries, folders, items
  • Working with Role Assignments

Lab:

  • Get a list of all users who have access to a Site Collection.
  • Get a list of all groups in a Site Collection.
  • Get a list of all groups a user belongs to.
  • List all users who may have access to a SharePoint securable.
  • Get a list of all securables with broken inheritance.

After completing this module, students will be able to:

  • Explore and document users and user permissions.
  • Explore and document SharePoint groups.
  • Explore and document broken inheritance.

Module 6: Managing Sites

This module explorers Site Collection and Web management from PowerShell.

Lessons:

  • Finding Inactive Webs
  • Creating and Deleting Site Collections
  • Getting Site Collection Data
  • Creating and Deleting Subsites
  • Working With SharePoint Designer Settings

Lab:

  • Create a report for inactive sites.
  • Create a site collection and subsites.
  • Delete a site.
  • Delete a site collection.
  • Disable SharePoint Designer in all site collections.

After completing this module, students will be able to:

  • Manage SharePoint Site Collections and webs from PowerShell.

Audience

  • SharePoint server administrators.
  • SharePoint auditors.
  • Also valuable for SharePoint developers.

1/03/2016

“Unable to display this Web Part” after XSLT Customization

The following applies to SharePoint 2013, 2016 and SharePoint Online.

 

The Error

“Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.”

image

The above error shows up in SharePoint 2013 and later when doing multi-level grouping with Data Form Web Parts. With the removal of many of the design features from SharePoint Designer 2013, I doubt there are too many people creating new XSLT customization. But if you are upgrading from 2010 or trying to implement a 2010 style customization then you many run into this error.

 

The Cause and the Fix

If you dig into the error logs you will find that this is reported as “Error while executing web part: System.StackOverflowException”. Turns out though that it is a timeout of the XSLT parser and has been around for quite a while. The fix is pretty easy, if you are on premises, just run a tiny PowerShell script from the SharePoint Management Shell.

image

$farm = Get-SPFarm
$farm.XsltTransformTimeOut = 10
$farm.Update()

Some of the articles say to increase it from the default of 1 second to 5 seconds. In my test environment I typically needed to increase it to 10 seconds. If you monitor the CPU on the server you will see that at least on lab-type virtual machines that a page load where you have this issue does put quite a load on the CPU.

SharePoint Online?  No joy for you! It appears that the default is 1 second, and you can’t change it.

 

There’s been a number of articles on the topic, mostly in the SP 2010 world:

http://thechriskent.com/tag/xslttransformtimeout/

http://blogs.msdn.com/b/joerg_sinemus/archive/2012/03/07/xslt-and-timeout-problem-when-transforming-runs-more-than-one-second.aspx

and many more: http://www.bing.com/search?q=xslttransformtimeout+sharepoint

 

.

1/01/2016

Views.Add() Cannot find an overload for "Add" and the argument count: "8".

 

I wrote a PowerShell script to create views. It worked in PowerShell 3 on SharePoint 2013. It failed in PowerShell 2 on SharePoint 2010.

To play it safe, I copied values from an existing view to insure the correct data types…

$web = Get-SPWeb http://sharepoint/sites/training
$list = $web.lists["Announcements22"]
$v = $list.views[0]
$list.Views.add("TestView",$v.ViewFields,$v.query,30,$true,$false,$v.Type,$false)

image

As I can count to 8 (usually) and I made sure the data types were correct, I then wasted a lot of time google/binging the error message.

So I then did the obvious thing for a developer, I fired up Visual Studio. And… found that there’s a datatype weirdness on the ViewFields parameter! The Add method is expecting System.Collections.Specialized.StringCollection while the View object actually returns Microsoft.SharePoint.SPViewFieldCollection.

The type conversion works in PowerShell 3:

image

But does not work in PowerShell 2:

image

 

My workaround? 

Use a handy method built into the Microsoft.SharePoint.SPViewFieldCollection type: ToStringCollection().

image

I could also have created the StringCollection object and copied the strings over using ForEach.

image

 

So why did it work in PowerShell 3 and not PowerShell 2? No idea! I’m guessing the “smarts” behind type conversion has improved. While the two collection objects are different (SPViewFieldCollection includes a .View property), the Items collection of both contain simple Strings.

 

.

12/06/2015

Get short lists of PowerShell cmdlets

 

I write a lot of documentation and I’m always looking for ways to make lists of things easier to read. Long lists of PowerShell commands have always been a problem as they usually should be sorted by the noun. That’s easy enough, but still can consume a lot of space on paper, and still not be too readable, especially when I want to see all the things I can do with a “user”, a “group” or some other object where I have a lot of cmdlets with the same noun.

For example, there are 135 AD cmdlets on my machine. By default Get-Command orders them by verb. But what are all of things I can do with a "user" or "group"?

image

We can sort on the Noun property, but we still get 135 lines of output:

image

 

So here is my solution… and while I'm happy with the results, I think the script is kind of ugly.

Get-Command *-ad* | Group Noun | 
  foreach { $_.Group | 
    foreach -Begin { $x = @{ noun = $_.Group[0].Noun; verb = ""} } 
            -Process { $x.verb += $_.Verb + "," } 
            -End {$x.verb = $x.verb.substring(0,$x.verb.length-1); $x; } } | 
  sort {$_.noun} | select {$_.noun}, {$_.verb} | ft -AutoSize

image

And now I can see at a glance that I can Get, New, Remove and Set. (And not Add or Delete!)

image

 

.

12/03/2015

SharePoint: Generate a report of inactive sites and owners

This article is for SharePoint 2007, 2010, 2013 and 2016 on premises. (2007 users see the note at the end of the article.)

Cleaning up inactive sites is a common best practice administrator activity. Finding these sites and getting a list of who to contact can take a bit of work. Here's a little PowerShell script to generate a report of all inactive sites, their Site Collection Administrators and their Full Control users.

 

Inactive Site?

Each web has a property named LastItemModifiedDate that can be used as one criteria for site activity. I say "one criteria" as the site may not have had been updated in months, but users still visit the site and view the content every day. In the scripts below we check for the inactivity using a Where that tests against a calculated date:

Where { $_.LastItemModifiedDate -lt ((Get-Date).AddMonths(-9)) }

You can change the test date by using AddDays, AddMonths and AddYears with negative numbers to "go back in time". The example above looks for webs not updated in the last 9 months.

Note: The LastItemModifiedDate (and all other internal SharePoint dates) is in GMT. To convert to local time use ".ToLocalTime()".

image

 

Create a report…

The following script generates a report that lists each web, last updated date, Site Collection Administrators and Full Control users. Note that if you added an Active Directory group with Full Control, only the group name will be listed, not all of the member users.

image

Get-SPSite -Limit All | 
  Get-SPWeb -Limit All | 
  Where { $_.LastItemModifiedDate -lt ((Get-Date).AddMonths(-9)) } |
  foreach {
    # the URL
    ""   #blank line
    $_.url
    "  LastItemModifiedDate: " + $_.LastItemModifiedDate
    "  Web has unique permissions: " + $_.HasUniquePerm

    # the Site Collection Administrators
    " Site Collection Administrators:"
    foreach ($user in $_.SiteAdministrators)
    {      
       "  " + $user.DisplayName + " " + $user.UserLogin
    }

    # full control users
    " Full Control Users:"
    foreach ($user in $_.Users)
    {
       if ( $_.DoesUserHavePermissions($user,[Microsoft.SharePoint.SPBasePermissions]::FullMask) )      
       { 
         "  " + $user.DisplayName + " " + $user.UserLogin
       }
    }
  }

 

Create a customized SPWeb object for further pipelining…

If you would rather have an output that can be piped on to other cmdlets then use the following script. It adds a PowerShell NoteProperty to each SPWeb object named FullControlUsers can be accessed as if it was a built-in property.

Get-SPSite -Limit All | 
  Get-SPWeb -Limit All | 
  Where { $_.LastItemModifiedDate -lt ((Get-Date).AddMonths(-9)) } |
  foreach {
  
    $TTNusers = @();   #empty collection

    foreach ($user in $_.Users)
    {
       if ( $_.DoesUserHavePermissions($user,[Microsoft.SharePoint.SPBasePermissions]::FullMask) )      
       { 
         $TTNusers += $user;  # add to the collection
       }
    }

    # add the new property
    $_ | Add-Member -type NoteProperty -name FullControlUsers -value $TTNusers;

    # forward the modified SPWeb object on through the piepline.
    $_;

  } | 
  Select Url, SiteAdministrators, FullControlUsers 

image

Or maybe change the "Select" to "Format-List":

image

 

Performance Tip

If this script is run during business hours on a large farm you could impact your users. Consider adding a Start-Sleep cmdlet just after the foreach to insert a small delay between webs. But of course, that will make your script take longer to complete.

image

.

For SharePoint 2007

Replace:

Get-SPSite -Limit All | Get-SPWeb -Limit All |

With:

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration")
$webapp = [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup("http://maxsp2013wfe")
$webapp.sites | Select -ExpandProperty AllWebs |

 

..

11/28/2015

SharePoint Content Type Inheritance

This article applies to SharePoint 2010, 2013 and 2016.

If you have worked around SharePoint for a while then you have heard the phrase "Everything is a list…". If everything is a list then everything should be an "item", right? Turns out that that is almost a fact. With the exception of only a handful of Content Types, they all inherit from"Item". In the end everything inherits from a base type named "System". The listing below is from a 2013 publishing site with a few extra features enabled to find as many Content Types as possible. The 2016 list is very similar, but is missing some of the Business Intelligence content types (Excel Services?).

A few examples:

  • Task <- Item <- System
  • Document <- Item <- System
  • Video <- System Media Collection <- Document Set <- Document Collection Folder <- Folder <- Item <- System

What does not inherit from Item?

  • Common Indicator Columns <- System  (hidden)
  • And the types that inherit from it:
    • Excel based Status Indicator <- Common Indicator Columns <- System
    • Fixed Value based Status Indicator <- Common Indicator Columns <- System
    • SharePoint List based Status Indicator <- Common Indicator Columns <- System
    • SQL Server Analysis Services based Status Indicator <- Common Indicator Columns <- System

 

    PowerShell to the rescue… again.

    To dump the hierarchy of Content Types I wrote a little PowerShell script that uses a recursive function. Just edit the URL to your site and you can get your list of Content Types.

    If you wanted to see the inheritance pattern another way, add the ID of the Content Type to your output, or just do a test like the following and note the pattern in the IDs:

      $web.ContentTypes | sort id | Select id, name

     

    The PowerShell script:

    function Get-CTypeParent ($ctype, $TTNstr)
    {
      if ($ctype.name -NE "System") {
       $TTNstr = $TTNstr + " <- " + $ctype.parent.name;
       $TTNstr = Get-CTypeParent $ctype.parent $TTNstr 
       }
      return $TTNstr;
    }
    
    $site = Get-SPSite http://yourserver/sites/yourSite
    $web = $site.RootWeb
    
    $web.ContentTypes | sort Group, Name | 
      group Group | 
        foreach { $_.Group  | 
                         foreach 
                           -Begin {"`n" + $_.Name} 
                           -Process { $str="  " + $_.Name ;  Get-CTypeParent $_ $str } 
                }
    

     

    The list of Content Types and their family history!

    This list is from SharePoint 2013. The 2016 list is very similar, but is missing some of the Business Intelligence content types (Excel Services?).

    _Hidden
      Administrative Task <- Task <- Item <- System
      Approval Workflow Task (en-US) <- SharePoint Server Workflow Task <- Workflow Task <- Task <- Item <- System
      Collect Feedback Workflow Task (en-US) <- SharePoint Server Workflow Task <- Workflow Task <- Task <- Item <- System
      Collect Signatures Workflow Task (en-US) <- SharePoint Server Workflow Task <- Workflow Task <- Task <- Item <- System
      Common Indicator Columns <- System
      Design File <- Document <- Item <- System
      Device Channel <- Item <- System
      Device Channel Mappings <- Document <- Item <- System
      Display Template <- Document <- Item <- System
      Display Template Code <- Display Template <- Document <- Item <- System
      Document Collection Folder <- Folder <- Item <- System
      DomainGroup <- Item <- System
      Health Analyzer Report <- Item <- System
      Health Analyzer Rule Definition <- Item <- System
      InfoPath Form Template <- Document <- Item <- System
      Office Data Connection File <- Document <- Item <- System
      Page Output Cache <- Item <- System
      PerformancePoint Base <- Item <- System
      PerformancePoint Monitoring Document Type <- Document <- Item <- System
      Person <- Item <- System
      Project Policy <- Item <- System
      Published Link <- Item <- System
      Publishing Approval Workflow Task (en-US) <- SharePoint Server Workflow Task <- Workflow Task <- Task <- Item <- System
      Reusable HTML <- Item <- System
      Reusable Text <- Item <- System
      RootOfList <- Folder <- Item <- System
      Rule <- Item <- System
      SharePoint Server Workflow Task <- Workflow Task <- Task <- Item <- System
      SharePointGroup <- Item <- System
      Signatures Workflow Task Deprecated <- SharePoint Server Workflow Task <- Workflow Task <- Task <- Item <- System
      System
      System Master Page <- Document <- Item <- System
      System Media Collection <- Document Set <- Document Collection Folder <- Folder <- Item <- System
      System Page <- Document <- Item <- System
      System Page Layout <- Document <- Item <- System
      Translation Package <- Document <- Item <- System
      Translation Status <- Document <- Item <- System
      Universal Data Connection File <- Document <- Item <- System
      User Workflow Document <- Document <- Item <- System
      Workflow History <- Item <- System
      Workflow Task <- Task <- Item <- System
      WorkflowServiceDefinition <- Item <- System
      WorkflowServiceSubscription <- Item <- Systemvi
     
    Business Intelligence
      Excel based Status Indicator <- Common Indicator Columns <- System
      Fixed Value based Status Indicator <- Common Indicator Columns <- System
      Report <- Document <- Item <- System
      Report Document <- Document <- Item <- System
      SharePoint List based Status Indicator <- Common Indicator Columns <- System
      SQL Server Analysis Services based Status Indicator <- Common Indicator Columns <- System
      Web Part Page with Status List <- Document <- Item <- System
     
    Community Content Types
      Category <- Item <- System
      Community Member <- Site Membership <- Item <- System
      Site Membership <- Item <- System
     
    Digital Asset Content Types
      Audio <- Rich Media Asset <- Document <- Item <- System
      Image <- Rich Media Asset <- Document <- Item <- System
      Rich Media Asset <- Document <- Item <- System
      Video <- System Media Collection <- Document Set <- Document Collection Folder <- Folder <- Item <- System
      Video Rendition <- Rich Media Asset <- Document <- Item <- System
     
    Display Template Content Types
      Control Display Template <- Display Template <- Document <- Item <- System
      Filter Display Template <- Display Template <- Document <- Item <- System
      Group Display Template <- Display Template <- Document <- Item <- System
      Item Display Template <- Display Template <- Document <- Item <- System
      JavaScript Display Template <- Document <- Item <- System
     
    Document Content Types
      Basic Page <- Document <- Item <- System
      Document <- Item <- System
      Dublin Core Columns <- Document <- Item <- System
      Form <- Document <- Item <- System
      Link to a Document <- Document <- Item <- System
      List View Style <- Document <- Item <- System
      Master Page <- Document <- Item <- System
      Master Page Preview <- Document <- Item <- System
      Picture <- Document <- Item <- System
      Web Part Page <- Basic Page <- Document <- Item <- System
      Wiki Page <- Document <- Item <- System
     
    Document Set Content Types
      Document Set <- Document Collection Folder <- Folder <- Item <- System
     
    Folder Content Types
      Discussion <- Folder <- Item <- System
      Folder <- Item <- System
      Summary Task <- Folder <- Item <- System
     
    Group Work Content Types
      Circulation <- Item <- System
      Holiday <- Item <- System
      New Word <- Item <- System
      Official Notice <- Item <- System
      Phone Call Memo <- Item <- System
      Resource <- Item <- System
      Resource Group <- Item <- System
      Timecard <- Item <- System
      Users <- Item <- System
      What's New Notification <- Item <- System
     
    List Content Types
      Announcement <- Item <- System
      Comment <- Item <- System
      Contact <- Item <- System
      East Asia Contact <- Item <- System
      Event <- Item <- System
      Issue <- Item <- System
      Item <- System
      Link <- Item <- System
      Message <- Item <- System
      Post <- Item <- System
      Reservations <- Event <- Item <- System
      Schedule <- Event <- Item <- System
      Schedule and Reservations <- Event <- Item <- System
      Task <- Item <- System
      Workflow Task (SharePoint 2013) <- Task <- Item <- System
     
    Page Layout Content Types
      Article Page <- Page <- System Page <- Document <- Item <- System
      Catalog-Item Reuse <- Page <- System Page <- Document <- Item <- System
      Enterprise Wiki Page <- Page <- System Page <- Document <- Item <- System
      Error Page <- Page <- System Page <- Document <- Item <- System
      Project Page <- Enterprise Wiki Page <- Page <- System Page <- Document <- Item <- System
      Redirect Page <- Page <- System Page <- Document <- Item <- System
      Welcome Page <- Page <- System Page <- Document <- Item <- System
     
    PerformancePoint
      PerformancePoint Dashboard <- PerformancePoint Base <- Item <- System
      PerformancePoint Data Source <- PerformancePoint Monitoring Document Type <- Document <- Item <- System
      PerformancePoint Filter <- PerformancePoint Base <- Item <- System
      PerformancePoint Indicator <- PerformancePoint Base <- Item <- System
      PerformancePoint KPI <- PerformancePoint Base <- Item <- System
      PerformancePoint Report <- PerformancePoint Base <- Item <- System
      PerformancePoint Scorecard <- PerformancePoint Base <- Item <- System
     
      
    Publishing Content Types
      ASP NET Master Page <- System Master Page <- Document <- Item <- System
      Html Master Page <- ASP NET Master Page <- System Master Page <- Document <- Item <- System
      Html Page Layout <- Page Layout <- System Page Layout <- Document <- Item <- System
      Page <- System Page <- Document <- Item <- System
      Page Layout <- System Page Layout <- Document <- Item <- System
     
    Special Content Types
      Unknown Document Type <- Document <- Item <- System

     

    The List Sorted By Ancestor

    Change the last line of the script to the following and you can see another pattern in the inheritance.

    $web.contenttypes | sort group, name | group group | foreach { $_.Group  | foreach -begin {"`n" + $_.Name} -process { $str="  " + $_.name ;  Get-CTypeParent $_ $str } }

    System ->   Item
    System -> Item ->   Announcement
    System -> Item ->   Circulation
    System -> Item ->   Comment
    System -> Item ->   Contact
    System -> Item ->   Device Channel
    System -> Item ->   Document
    System -> Item ->   DomainGroup
    System -> Item ->   East Asia Contact
    System -> Item ->   Event
    System -> Item ->   Folder
    System -> Item ->   Health Analyzer Report
    System -> Item ->   Health Analyzer Rule Definition
    System -> Item ->   Holiday
    System -> Item ->   Issue
    System -> Item ->   Link
    System -> Item ->   Message
    System -> Item ->   New Word
    System -> Item ->   Official Notice
    System -> Item ->   Page Output Cache
    System -> Item ->   PerformancePoint Base
    System -> Item ->   Person
    System -> Item ->   Phone Call Memo
    System -> Item ->   Post
    System -> Item ->   Published Link
    System -> Item ->   Resource
    System -> Item ->   Resource Group
    System -> Item ->   Reusable HTML
    System -> Item ->   Reusable Text
    System -> Item ->   Rule
    System -> Item ->   SharePointGroup
    System -> Item ->   Task
    System -> Item ->   Timecard
    System -> Item ->   Users
    System -> Item ->   What's New Notification
    System -> Item ->   Workflow History
    System -> Item ->   WorkflowServiceDefinition
    System -> Item ->   WorkflowServiceSubscription
    System -> Item -> Document ->   Basic Page
    System -> Item -> Document ->   Design File
    System -> Item -> Document ->   Device Channel Mappings
    System -> Item -> Document ->   Display Template
    System -> Item -> Document ->   Dublin Core Columns
    System -> Item -> Document ->   Form
    System -> Item -> Document ->   InfoPath Form Template
    System -> Item -> Document ->   JavaScript Display Template
    System -> Item -> Document ->   Link to a Document
    System -> Item -> Document ->   List View Style
    System -> Item -> Document ->   Master Page
    System -> Item -> Document ->   Master Page Preview
    System -> Item -> Document ->   Office Data Connection File
    System -> Item -> Document ->   PerformancePoint Monitoring Document Type
    System -> Item -> Document ->   Picture
    System -> Item -> Document ->   Report Document
    System -> Item -> Document ->   Rich Media Asset
    System -> Item -> Document ->   System Master Page
    System -> Item -> Document ->   System Page
    System -> Item -> Document ->   System Page Layout
    System -> Item -> Document ->   Translation Package
    System -> Item -> Document ->   Translation Status
    System -> Item -> Document ->   Universal Data Connection File
    System -> Item -> Document ->   Unknown Document Type
    System -> Item -> Document ->   User Workflow Document
    System -> Item -> Document ->   Wiki Page
    System -> Item -> Document -> Basic Page ->   Web Part Page
    System -> Item -> Document -> Display Template ->   Control Display Template
    System -> Item -> Document -> Display Template ->   Display Template Code
    System -> Item -> Document -> Display Template ->   Filter Display Template
    System -> Item -> Document -> Display Template ->   Group Display Template
    System -> Item -> Document -> Display Template ->   Item Display Template
    System -> Item -> Document -> PerformancePoint Monitoring Document Type ->   PerformancePoint Data Source
    System -> Item -> Document -> Rich Media Asset ->   Audio
    System -> Item -> Document -> Rich Media Asset ->   Image
    System -> Item -> Document -> Rich Media Asset ->   Video Rendition
    System -> Item -> Document -> System Master Page ->   ASP NET Master Page
    System -> Item -> Document -> System Master Page -> ASP NET Master Page ->   Html Master Page
    System -> Item -> Document -> System Page ->   Page
    System -> Item -> Document -> System Page -> Page ->   Article Page
    System -> Item -> Document -> System Page -> Page ->   Catalog-Item Reuse
    System -> Item -> Document -> System Page -> Page ->   Enterprise Wiki Page
    System -> Item -> Document -> System Page -> Page ->   Error Page
    System -> Item -> Document -> System Page -> Page ->   Redirect Page
    System -> Item -> Document -> System Page -> Page ->   Welcome Page
    System -> Item -> Document -> System Page -> Page -> Enterprise Wiki Page ->   Project Page
    System -> Item -> Document -> System Page Layout ->   Page Layout
    System -> Item -> Document -> System Page Layout -> Page Layout ->   Html Page Layout
    System -> Item -> Event ->   Reservations
    System -> Item -> Event ->   Schedule
    System -> Item -> Event ->   Schedule and Reservations
    System -> Item -> Folder ->   Discussion
    System -> Item -> Folder ->   Document Collection Folder
    System -> Item -> Folder ->   RootOfList
    System -> Item -> Folder ->   Summary Task
    System -> Item -> Folder -> Document Collection Folder ->   Document Set
    System -> Item -> Folder -> Document Collection Folder -> Document Set ->   System Media Collection
    System -> Item -> Folder -> Document Collection Folder -> Document Set -> System Media Collection ->   Video
    System -> Item -> PerformancePoint Base ->   PerformancePoint Dashboard
    System -> Item -> PerformancePoint Base ->   PerformancePoint Filter
    System -> Item -> PerformancePoint Base ->   PerformancePoint Indicator
    System -> Item -> PerformancePoint Base ->   PerformancePoint KPI
    System -> Item -> PerformancePoint Base ->   PerformancePoint Report
    System -> Item -> PerformancePoint Base ->   PerformancePoint Scorecard
    System -> Item -> Task ->   Administrative Task
    System -> Item -> Task ->   Workflow Task
    System -> Item -> Task ->   Workflow Task (SharePoint 2013)
    System -> Item -> Task -> Workflow Task ->   PSWApprovalTask
    System -> Item -> Task -> Workflow Task ->   SharePoint Server Workflow Task
    System -> Item -> Task -> Workflow Task -> SharePoint Server Workflow Task ->   Approval Workflow Task (en-US)
    System -> Item -> Task -> Workflow Task -> SharePoint Server Workflow Task ->   Collect Feedback Workflow Task (en-US)
    System -> Item -> Task -> Workflow Task -> SharePoint Server Workflow Task ->   Collect Signatures Workflow Task (en-US)
    System -> Item -> Task -> Workflow Task -> SharePoint Server Workflow Task ->   Publishing Approval Workflow Task (en-US)
    System -> Item -> Task -> Workflow Task -> SharePoint Server Workflow Task ->   Signatures Workflow Task Deprecated

     


     

    System ->   Item
    System -> Item ->   Announcement
    System -> Item ->   Circulation
    System -> Item ->   Comment
    System -> Item ->   Contact
    System -> Item ->   Device Channel
    System -> Item ->   Document
    System -> Item ->   DomainGroup
    System -> Item ->   East Asia Contact
    System -> Item ->   Event
    System -> Item ->   Folder
    System -> Item ->   Health Analyzer Report
    System -> Item ->   Health Analyzer Rule Definition
    System -> Item ->   Holiday
    System -> Item ->   Issue
    System -> Item ->   Link
    System -> Item ->   Message
    System -> Item ->   New Word
    System -> Item ->   Official Notice
    System -> Item ->   Page Output Cache
    System -> Item ->   PerformancePoint Base
    System -> Item ->   Person
    System -> Item ->   Phone Call Memo
    System -> Item ->   Post
    System -> Item ->   Published Link
    System -> Item ->   Resource
    System -> Item ->   Resource Group
    System -> Item ->   Reusable HTML
    System -> Item ->   Reusable Text
    System -> Item ->   Rule
    System -> Item ->   SharePointGroup
    System -> Item ->   Task
    System -> Item ->   Timecard
    System -> Item ->   Users
    System -> Item ->   What's New Notification
    System -> Item ->   Workflow History
    System -> Item ->   WorkflowServiceDefinition
    System -> Item ->   WorkflowServiceSubscription
    System -> Item -> Document ->   Basic Page
    System -> Item -> Document ->   Design File
    System -> Item -> Document ->   Device Channel Mappings
    System -> Item -> Document ->   Display Template
    System -> Item -> Document ->   Dublin Core Columns
    System -> Item -> Document ->   Form
    System -> Item -> Document ->   InfoPath Form Template
    System -> Item -> Document ->   JavaScript Display Template
    System -> Item -> Document ->   Link to a Document
    System -> Item -> Document ->   List View Style
    System -> Item -> Document ->   Master Page
    System -> Item -> Document ->   Master Page Preview
    System -> Item -> Document ->   Office Data Connection File
    System -> Item -> Document ->   PerformancePoint Monitoring Document Type
    System -> Item -> Document ->   Picture
    System -> Item -> Document ->   Report Document
    System -> Item -> Document ->   Rich Media Asset
    System -> Item -> Document ->   System Master Page
    System -> Item -> Document ->   System Page
    System -> Item -> Document ->   System Page Layout
    System -> Item -> Document ->   Translation Package
    System -> Item -> Document ->   Translation Status
    System -> Item -> Document ->   Universal Data Connection File
    System -> Item -> Document ->   Unknown Document Type
    System -> Item -> Document ->   User Workflow Document
    System -> Item -> Document ->   Wiki Page
    System -> Item -> Document -> Basic Page ->   Web Part Page
    System -> Item -> Document -> Display Template ->   Control Display Template
    System -> Item -> Document -> Display Template ->   Display Template Code
    System -> Item -> Document -> Display Template ->   Filter Display Template
    System -> Item -> Document -> Display Template ->   Group Display Template
    System -> Item -> Document -> Display Template ->   Item Display Template
    System -> Item -> Document -> PerformancePoint Monitoring Document Type ->   PerformancePoint Data Source
    System -> Item -> Document -> Rich Media Asset ->   Audio
    System -> Item -> Document -> Rich Media Asset ->   Image
    System -> Item -> Document -> Rich Media Asset ->   Video Rendition
    System -> Item -> Document -> System Master Page ->   ASP NET Master Page
    System -> Item -> Document -> System Master Page -> ASP NET Master Page ->   Html Master Page
    System -> Item -> Document -> System Page ->   Page
    System -> Item -> Document -> System Page -> Page ->   Article Page
    System -> Item -> Document -> System Page -> Page ->   Catalog-Item Reuse
    System -> Item -> Document -> System Page -> Page ->   Enterprise Wiki Page
    System -> Item -> Document -> System Page -> Page ->   Error Page
    System -> Item -> Document -> System Page -> Page ->   Redirect Page
    System -> Item -> Document -> System Page -> Page ->   Welcome Page
    System -> Item -> Document -> System Page -> Page -> Enterprise Wiki Page ->   Project Page
    System -> Item -> Document -> System Page Layout ->   Page Layout
    System -> Item -> Document -> System Page Layout -> Page Layout ->   Html Page Layout
    System -> Item -> Event ->   Reservations
    System -> Item -> Event ->   Schedule
    System -> Item -> Event ->   Schedule and Reservations
    System -> Item -> Folder ->   Discussion
    System -> Item -> Folder ->   Document Collection Folder
    System -> Item -> Folder ->   RootOfList
    System -> Item -> Folder ->   Summary Task
    System -> Item -> Folder -> Document Collection Folder ->   Document Set
    System -> Item -> Folder -> Document Collection Folder -> Document Set ->   System Media Collection
    System -> Item -> Folder -> Document Collection Folder -> Document Set -> System Media Collection ->   Video
    System -> Item -> PerformancePoint Base ->   PerformancePoint Dashboard
    System -> Item -> PerformancePoint Base ->   PerformancePoint Filter
    System -> Item -> PerformancePoint Base ->   PerformancePoint Indicator
    System -> Item -> PerformancePoint Base ->   PerformancePoint KPI
    System -> Item -> PerformancePoint Base ->   PerformancePoint Report
    System -> Item -> PerformancePoint Base ->   PerformancePoint Scorecard
    System -> Item -> Task ->   Administrative Task
    System -> Item -> Task ->   Workflow Task
    System -> Item -> Task ->   Workflow Task (SharePoint 2013)
    System -> Item -> Task -> Workflow Task ->   PSWApprovalTask
    System -> Item -> Task -> Workflow Task ->   SharePoint Server Workflow Task
    System -> Item -> Task -> Workflow Task -> SharePoint Server Workflow Task ->   Approval Workflow Task (en-US)
    System -> Item -> Task -> Workflow Task -> SharePoint Server Workflow Task ->   Collect Feedback Workflow Task (en-US)
    System -> Item -> Task -> Workflow Task -> SharePoint Server Workflow Task ->   Collect Signatures Workflow Task (en-US)
    System -> Item -> Task -> Workflow Task -> SharePoint Server Workflow Task ->   Publishing Approval Workflow Task (en-US)
    System -> Item -> Task -> Workflow Task -> SharePoint Server Workflow Task ->   Signatures Workflow Task Deprecated

     

     

     

     

     

    11/14/2015

    Sorting Hashtables and SharePoint Properties Lists with PowerShell

     

    Sometimes the obvious just does not work… I was doing some work with SharePoint publishing sites, trying to find some of the data in the SPWeb AllProperties property. AllProperties looks like a collection of Names and Values. Actually it is Hashtable object.

    My first attempt looked like this:

        $psite.AllWebs[0].AllProperties | sort -Property name

    image

    The output was random, not sorted as expected. After too long messing with trial and error, I did a web search and found a TechNet "Windows PowerShell Tip of the Week" article with the answer. Hashtable objects and sort just don't work together. We need to get an enumerator for the hash table and work with that…

       $psite.AllWebs[0].AllProperties.GetEnumerator() | sort -Property name

    image

    That's the output I was looking for!

    If you pipe both of the above to Get-Member you will see that the first just returns a Hashtable object that includes a collection of Keys and a collection of Values. The second one, using GetEnumerator, returns a single DictionaryEntry object (one at a time through the pipeline) with a Key and a Value property. Now we have something to sort on!

    image

    .

    Weird SharePoint Icons = Timeout!


    Have you ever had a SharePoint page "explode"? Odds are something from the server timed out. In the example below the CSS files never got loaded. The links timed out. A simple refresh should fix it. If it does, let your server admins know about the issue.

    BTW, those weird looking icon collections are call image sprites.

    image

     

    If the refresh does not fix the problem, you may have a broken master page. (Have you been playing around with SharePoint Designer?) You can either use SharePoint Designer to select a working master page or edit your site's URL to take you to the Site Settings page and select one there..
    Change:
      http://yourServer/sites/yourSite/Pages/Default.aspx  (or whatever your URL looks like)
    to something like:
      http://yourServer/sites/yourSite/_layouts/settings.aspx  (2013 will redirect and add a "15" to the URL.)

    From that page you can select another master page or make other changes to fix the issue. In some cases you even need to open SharePoint Designer to undo the change you made or to select another master page. For a publishing site click Master Pages in the Look and Feel section of the Site Settings page. If you see the following message then you do have a master page problem.

    image

    In some cases, just clicking OK and selecting the same master page will fix the problem. Otherwise, select Seattle or Oslo and see if that gets your site working again.

    11/04/2015

    The specified module 'Microsoft.Online.SharePoint.PowerShell' was not loaded

     

    When trying to load the SharePoint Online PowerShell module into the ISE or an existing shell you may get the error below. Simple problem with a non-obvious error message… The fix is easy… after installing the SharePoint Online Management Shell, run PowerShell or the ISE as Administrator.

    PS C:\> Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking
    Import-Module : The specified module 'Microsoft.Online.SharePoint.PowerShell' was not loaded because no valid 
    module file was found in any module directory.
    At line:1 char:1
    + Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ResourceUnavailable: (Microsoft.Online.SharePoint.PowerShell:String) [Import-Mo 
       dule], FileNotFoundException
        + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

    10/30/2015

    Trick or Treat? A Day in the Life of the SharePoint Share Button…

     

    Every once and a while I work a little on my next book, SharePoint 2103 Security. At the pace I'm going it may never get done. As I'm always a bit surprised at the response and disbelief I get when I tell people about the Share button, I added a chapter to the book about the Share buttons, what they do and what you can do about them. As the book may never get done… I'll click a "share" button and share part of it with you. 

     

    Is the Share Button Evil? 

    So how about a little demo. One of my users, Sam, thinks Susan would be interested in one of our purchase orders. Here’s a walkthrough of what Sam, Susan, a few other strangers, and the Site Owner might see.

     

    Mike adds a team member to the new site

    Mike, the Site Owner of a new site, adds Sam to the members group.

    1. Mike goes to Settings (gear), Site Settings, Site Permissions.
      clip_image002
    2. There he notes that this site has unique permissions, i.e., does not inherit permissions from the parent site, and that users currently only have access to the site through group membership. He also notes the “different permissions” message and checks it to see that it only applies to the MicroFeed.
       
    3. Mike adds Sam to the Team Subsite Members group. Note that the group has the default “Edit” permission level. (Sam can add, edit and delete documents, and customize and delete the entire library!)
      clip_image004

     

    Along comes Sam…

    Sam is browsing the Purchase Orders library and thinks Susan would be interested in one of the Purchase Orders.

    1. Sam checkmarks one of the purchase orders and clicks one of the Share buttons. (Share buttons are above the library, in the ribbon and in the “…” menus.)
      clip_image006 
    2. Susan receives an email with a link to the document. Sam got copied on the email, but the Site Owner did not.
      clip_image008

     

    Susan gets an email…

    Susan receives the email and out of curiosity…

    1. Susan clicks the link in the email… the document opens in Office Word Apps (now called Office Online). If the document is not supported by Office Web Apps or the browser then Susan will get a blank page with a download prompt.
      clip_image010 
    2. Susan sees the “Share” button! She clicks it and shares the file with a coworker!
      clip_image012

     

    And then there's Stella…

    1. Stella clicks the link, and not knowing about the auto-save features of Office Web Apps, makes a fun edit.
      clip_image014 
    2. Not knowing about the “comments thing” she adds a couple little test comments.
      image
       
    3. Stella thinks this is kind of fun and clicks the Share button…………
       
    4. Later she sees the site name (“Team Subsite” in this demo) and clicks the link.
      clip_image018 
      As she has "Limited Access" to the site she can see the library page, and there only the document that was shared with her. While she cannot see Quick Launch or the Top Link bar, she can see other custom text and links that you may have added to the site's master page. She may also see that you have changed your site logo to a picture of your new top secret product.

     

    Bad day for Mike!

    1. The next day Mike gets a phone call from the team member who created the purchase order asking “Who is Stella” and why is she making changes to my purchase orders? I thought you only granted access to this site to our team? Oh, and I’m going to talk to HR about some of the comments she added!”
          image 
    2. Mike starts doing detective work…
      1. The file has been modified. (“Gee I wish I had turned on versioning!” he says.)
      2. He checkmarks the purchase order, clicks the Share button (one of several ways to do this) and clicks Shared With, and sees “there’s a lot of sharing going on!”
           clip_image020 
      3. He notes that Sam is on the team, but has no idea who Stella or Susan are. Hoping to find who shared this file with these people, he clicks ADVANCED.
            clip_image022 
      4. But, there’s nothing there that he hadn’t already seen.
         
      5. He clicks Check Permissions, enters Stella's name and only learns that she has Limited Access. This only lets him know that she has special permissions set on some object in the site… could be one item or hundreds… and there's nothing out of the box that will list them all in one step.
            image 
      6. Sam goes to Settings, Site Settings, Site Permissions to see if there anything to be learned there.
           clip_image024 
      7. Clicking Show users he again finds that Stella and Susan have Limited Access permissions to the site.
            clip_image026 
      8. Clicking Show these items he finds he has a dozen libraries with hundreds of “shared” files, all with broken inheritance.
         
      9. Mike thinks about finding another job…
         
    3. A few days later Mike creates a new group called Managers and adds three people to the group. Later one of those people call Mike about a missing purchase order. “Hey Mike, I can see PO’s 12345, 12346, 12348, 12349, but not 12347. Did we skip a number?”
      1. With broken inheritance Mike has to remember to grant access to all broken inheritance files whenever adding new groups.
         
    4. Mike gives up, resets all of the broken inheritance (hours of work) and turns off the ability for team members to share:
          clip_image028
      He did leave “Allow access requests” for those special situations.
       
    5. If he unchecks all of the Access Request options then the Share buttons are still displayed to tempt the users, but when they click the buttons they will get this popup:
          image

      You may just want to hide those Share buttons! Take a look at this article: http://techtrainingnotes.blogspot.com/2015/08/hiding-evil-sharepoint-2013-share.html

     

    And did you know…

    Visitors can share! But at least it’s not automatic. When they click Share and complete the form a Sharing Request is sent to the site owner (actually the name listed in the Access Request Settings dialog box). And there’s a surprise… the new user by default gets Edit Permission Level access to the document!

    The flow:

    1. Visitor user checkmarks a file, clicks Share and share the file.
    2. A popup is displayed:
          clip_image030 
    3. The site owner gets an email,
      clip_image032
      and if they go to Settings, Site Settings, Site Permissions they will see:
          clip_image034 
    4. If the site owner clicks the link in the email and approves, the user gets the Edit Permission level. If the site owner goes to Site Permissions and click the link there, they can click “…” and pick a permission.
      clip_image036

     

    Takeaways…

    1. Sharing a file is easy!
       
    2. By default, team members can share any file.
       
    3. Visitors can even generate Share Requests that could result in someone else getting “Edit” permissions on the document.
       
    4. Sharing breaks inheritance and complicates future site maintenance.
       
    5. There is no audit trail. No “who done it” report.
       
    6. There are no built-in tools or reports to list everything a user has access to. (Third party tools and/or PowerShell to the rescue!)
       
    7. It can be turned off. The buttons can even be hidden with a customization.
       
    8. Having items with broken inheritance will create a lot of additional work for site owners and auditors.

     

    .

    Oh, and if you can't wait for the book…

    Buy the 2010 book. A good 98% of it still applies to 2013. The only big things missing are the Edit Permission Level, the Share buttons and App permissions.

    SharePoint 2010 Security for the Site Owner: and for Administrators and Developers!

     

     

    .

    10/17/2015

    SharePoint: This service isn't available right now. User has Empty Lookup Column

     

    The following screen captures are from SP 2013. SP 2010 behaves in the same way except for the error message.

     

    Scenario:

    • You grant Contribute or Edit permissions to a user to a list or library, but not to the site.
    • When they visit the list/library, one column is blank that should have data.
    • When they edit an item the field is blank and the dropdown is empty.
    • When they click LIBRARY, Quick Edit, and then click the dropdown for the column the get the following error: (Clicking the link does nothing.)
          image
         Note: SP 2010 just displays an empty dropdown in the Datasheet View with no message about a "service" or other error.

      when they should be getting this:
          image

    The issue? It's a look up column, and the user does not have at least Read permissions to the lookup list. (Convenient that I named it "Lookup" huh?)

    Other interesting side effects of not having permissions to the lookup list:

    • If the lookup column is Required, then the user cannot edit anything in the list/library.
    • If the lookup column is not Required, then when the user edits the item, the data in the lookup column is deleted!

     

    .

    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.