1/29/2015

PowerShell Sorting Tip for Enumerations

 

Do you ever have a PowerShell script that just won't sort right?

The problem? PowerShell makes assumptions, and not always the ones you would make. For example let's get a list of SharePoint lists and sort them by their BaseTemplate property:

    $mtg = Get-SPWeb http://maxsp2013wfe/sites/Meetings
    $mtg.Lists | Sort BaseTemplate | Select BaseTemplate, Title

Is the result you would expect?

image

Not what I first expected… but there's a hint hiding there though… Why is the BaseTemplate column right aligned as if was numeric?

If we take the above script and pipe it to Get-Member we find that BaseTemplate is not a string! It's an object of some kind. It's an SPListTemplateType object!

image

So let's see what that is… Doing a Bing on Microsoft.SharePoint.SPListTemplateType reveals that it is an enumeration, which internally is a number. If you look at the list in the MSDN article you will see both the text and numeric values of the base types.

image

What we need is the display text for the enumeration, and we can get that by using the ToString() method. As that would then be an expression, we need to add the annoying curly brackets and the $_. notation.

    $mtg.Lists | Sort { $_.BaseTemplate.ToString() } | Select BaseTemplate, Title

And now we get:

image

And that's more like it! (except for the right align stuff that going on)

Convert the column in the Select to a string and all's well!

    $mtg.Lists | Sort {$_.BaseTemplate.ToString()} | Select {$_.BaseTemplate.ToString()}, Title

image

 

So what were the PowerShell assumptions?

  1. To display the text value of the enumeration, and align it as a number.
  2. To sort on the numeric value of the enumeration.

(And you know what "assume" does, right?)  Smile

 

.

1/26/2015

SharePoint Auditing and Site Content Administration using PowerShell

 

If you have attended one of my SharePoint Saturday PowerShell presentations or read my PowerShell series at SharePoint Pro magazine, then you know a bit about what's possible with PowerShell. This Friday. January, 30th, I will be delivering one of the more fun classes I do: "SharePoint 2010 and 2013 Auditing and Site Content Administration using PowerShell". If you are a SharePoint administrator and need to "find and inventory stuff" in SharePoint then you need this class! Whatever is hiding in SharePoint is visible to the PowerShell user, if you know where to look.

Class details are here: http://www.maxtrain.com/Classes/ClassInfo.aspx?Id=119394
You can join us at MAX Technical Training in Cincinnati or attend remotely from your office or home.

This class is available world wide though Microsoft training partners
and the Microsoft Courseware library. Just ask for course 55095.

 

MS-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 take home cheat sheet with over 175 PowerShell scripts plus the general patterns to create your own scripts. These scripts cover:

  • 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
  • general tips for counting, reformatting and exporting results;
  • drilling up and down the SharePoint object model
  • and much more…

 

Prerequisites: You should have good SharePoint skills as and end user and administrator along with some practical experience with PowerShell.

 

.

1/22/2015

Cincinnati SharePoint User Group Remote Access Tonight

 

Go here after 4:00 PM EST for login instructions: www.CincinnatiSPUG.org

Meeting will start at 6:00 for food, social and networking. Presentation will start at 6:30 PM EST.

Attending physically or remotely? Register here and let us know! http://www.meetup.com/TechLife-Cincinnati/events/219938769/

Support your local user group!

(yah, a movie title rip off…)

Your local IT user groups… one of the few really useful free things in life. Attend, network, learn and share!

For a list of Cincinnati area user groups see here:
http://www.maxtrain.com/UserGroups.aspx

For a list of upcoming user group events see here:
http://www.meetup.com/TechLife-Cincinnati/

And don't forget tonight's Cincinnati SharePoint user group meeting!
http://www.meetup.com/TechLife-Cincinnati/events/219938769/

A list of SharePoint User Groups:
http://www.sharepointfest.com/portal/index.php/2012-04-13-17-00-56/sharepoint-user-groups/north-america/united-states

A list of .Net User Groups:
http://blogs.msdn.com/b/dotnet/p/dotnetusergroups.aspx

A large list of user groups / communities:
https://www.technicalcommunity.com/CommunityDirectory.aspx

Benefits of user groups:

  • Networking! Bring your business cards, questions and ideas to the meeting!
  • Networking!  Looking for a job? Looking for an new employee?
  • Free consulting! Really! Many of the user group attendees work for consulting firms. Ask away!
  • Free food! Most user groups supply pizza or sandwiches at the meeting.
  • Discounts! User groups have access to book, training and other discounts. If you don't see them listed on the user group's web sites, then ask.
  • Learn! Every session will present something new. New products, new ideas, new twists on old ideas or just a new way to think about or use the technology.
  • Stay up to date… about bugs, fixes, tricks, events, and stuff you would have never even thought about.
  • Get a raise! (Maybe… just present the next great idea at work that your stole from the user group meeting.)
  • Free stuff! Most user groups get lots of books, gadgets and toys from the sponsors that they pass out at the meetings.

 

Reasons not to attend:

  • There's something better on TV tonight, I don't have a DVR, and it will really improve my life!
  • Don't like the topics. Well… recommend some new topics. We will find the speakers! (Or volunteer to speak!)
  • Don't like free food, books, toys and other goodies
  • Don't need to network! I already know everything and could not be any better at my job! (Well then you should come to the meetings and share!)
  • Boss won't let me go.  Get a better boss! (Unless we are speaking about your better half…) Or just tell your boss that they usually charge $500 for this kind of event, but you know someone and can get the training, network and consulting for free.

 

What you can do…

  • Attend and share! I guarantee that you know something about the technology that no one else at the meeting does.
  • Volunteer. There's always something that needs to be done.
  • Get your company to sponsor a meeting! It will be some of the least expensive promotion they do all year.
  • Speak! We always need speakers. Not comfortable speaking? Ask about 5-15 minute lightning rounds. Little or no prep needed. Just share something cool that you have done, or something interesting you have just figured out. (Adding "speaker" to your resume is pretty cool too!)
  • Promote the meetings! Coworkers, Twitter, Blogs, students… get the word out!
  • Thank the sponsors!  (and consider buying their products)
  • Thank the volunteers!  (and consider buying them a cold beverage!)
  • Thank the speakers!  (and consider buying their services, their books… or a cold beverage!)

 

.

1/19/2015

Cincinnati SharePoint User Group Meeting!

Register here: http://www.meetup.com/TechLife-Cincinnati/events/219938769/

User group site: http://www.CincinnatiSPUG.org

Thursday, January 22, 2015
6:00 PM to 8:00 PM

Speaker: Justin Kobel   

Title:   Branding SharePoint 2013 without breaking everything

SharePoint 2013 (and SharePoint Online) have given us a lot of different tools to offer a better design experience to our users; but it’s  never as easy as the marketing materials make it out to be.  In this session we’ll look at a couple of different methods to apply branding to SharePoint, while also making sure that you do not break existing SharePoint Functionality.

Topics:

  • Branding the easy way  (SharePoint themes and Office 365 themes)
  • Design Manager
  • Minimal Download Strategy (and why you will hate it)
  • Deploying via WSP
  • Deploying via the App Model

We will try to have remote access available. Check the web site Thursday afternoon for details. http://www.CincinnatiSPUG.org

 

.

1/11/2015

How do you spell SharePoint?

 

Ok, this is useless trivia… In the list of SharePoint 2013 Search Result Types (Settings, Site Settings, Search section, Result Types) it looks like someone at Microsoft is not sure how to spell SharePoint! At least they did not spell it SharePint!

Oh wait… they made up for it in the next word. Everywhere in TechNet microblog has a lowercase "b"!

So, for accuracy, in my courseware should I use "Sharepoint MicroBlog", "SharePoint MicroBlog" or "SharePoint Microblog"?   Decisions, decisions, decisions… Oh the life of a tech writer…

image

 

.

1/07/2015

Still exam procrastinating? Second Shot is back!

 

Time for New Year's resolutions? Or just finish some of last years…

Take any Microsoft Certified Professional (MCP) exam between January 5, 2015, and May 31, 2015. If you don't pass, get a free retake!

All of the Microsoft Certified Solutions Associate (MCSA), Microsoft Certified Solutions Expert (MCSE), Microsoft Certified Solutions Developer (MCSD), and Microsoft Specialist certification exams are eligible. Microsoft Technology Associate (MTA) exams and Microsoft Office Specialist (MOS) exams do not qualify for this promotion.

Details here: https://www.microsoft.com/learning/en-us/second-shot.aspx

 

.

1/06/2015

Louisville SharePoint User Group Live Meeting!

 

Virtual meeting: Thursday, January 8, 2015  6:00 PM to 7:30 PM

Register and find connection information here: http://www.meetup.com/Lou-SPU-Louisville-SharePoint-Users-Meetup/events/219133851/

With the unpredictable weather in January, the Louisville SharePoint User Group has decided to hold an all-virtual event.  Paul Stork, a SharePoint MVP and Microsoft Certified Master based out of the Cleveland area will be our speaker.  Since this will be our first "outside" speaker, I would love to make this a well-attended event.

Topic: Intro to Office Graph and Delve: Finding what you want before you know you need it

At the SharePoint Conference in the Spring of 2014 Microsoft announced a new Product called Project "Oslo".  Project "Oslo" is made up of two new product offerings; Office Graph and Delve. Office Graph is a new technology that uses a combination of machine learning and SharePoint search to explore the relationships between People you follow, the content they author, and the social activities they participate in.  The information revealed by Office Graph is then presented to users in a personalized interface using Delve in Office 365.  By leveraging these new technologies Delve can present you with a proactive look at content you might be interested in before you even think to search for it.  In this talk we'll demonstrate how Delve works and review the underlying architecture of Delve and Office Graph.  We'll also provide some examples of how developers can leverage Delve to create new applications or surface Office Graph content in SharePoint.

See you there! (virtually!)

 

.

12/07/2014

Just how much is PI in .Net?

 

<Silly blog article>

 

The .Net Framework includes a math library that includes a constant for PI. Just how much is PI?

The MSDN article says:

   image

 

The Visual Studio debugger says:

   image

The Visual Studio Autos and Locals windows say:

   image

And when written from Console.WriteLine:

   image

Or does it?  Reformatted with "R" WriteLine matches the value reported from the debugger.

   image

and for the final test:

   image

 

So who is right? According to Wikipedia the first 50 digits are 3.14159265358979323846264338327950288419716939937510. Based on that number the MSDN documentation describes a more accurate number than returned by Math.PI.

 

From the .Net double documentation: here and here

  • Double-precision numbers store an approximation of a real number.
  • Holds signed IEEE 64-bit (8-byte) double-precision floating-point numbers
  • A Double value has up to 15 decimal digits of precision, although a maximum of 17 digits is maintained internally
  • When you work with floating-point numbers, remember that they do not always have a precise representation in memory.
  • The documentation's examples only have 18 digits, so PI as a double should be apx 3.14159265358979324

 

In the end…

3.14159265358979323846264338327950288419716939937510  Wikipedia
3.14159265358979323846   MSDN documentation for Math.PI
3.14159265358979324        What I would guess based on the documentation for doubles
3.1415926535897931          Returned in Visual Studio debugging tools
3.1415926535897931          Returned by the ToString() conversion through WriteLine formatted with "R"
3.14159265358979             Returned by the ToString() conversion through WriteLine

and just for fun… JavaScript says:
3.141592653589793

 

So…  for the important question… is the value of PI in the documentation for Math.PI wrong?  Smile

   image

 

</Silly blog article>

Now I have to get back to some real work!

.

11/23/2014

Yet another unannounced change in Office 365? App Launcher?

 

Update… it was announced! See here: http://blogs.office.com/2014/10/16/organize-office-365-new-app-launcher-2/   For me, it was unannounced. I missed the blog article. There was no mention of the change in the Office 365 Admin Center "Message Center". It just showed up in one of my subscriptions. Turns out it is also "mentioned" in the Office 365 Roadmap site, but with no links or any idea where it might show up in O365. And… I have "opted into First Release" and did not see it back in October. It just showed up this week.

If you are using O365 then you should proactively notify/warn/train your users before this just appears in your site.


Yet Another Change…

The navigation bar across the top of SharePoint 2013 is called the Suite Bar. What does yours look like? I'm getting different results from different subscriptions.

Mine used to look like this:

image

Now it looks like this in one subscription:

image

The nine little squares on the left is a new button:

image

So far:

Now all of my training materials, cheat sheets and book screen captures are all out of date!

Office 365 has been, and I guess will always be, a moving target. Ready… Fire… Aim…

 

Is it better?

  • Except for the Sites link, everything else now requires at least one more click.
  • The Admin menu is now missing. While there is a button marked "Admin", it just takes me to the Portal site. If I need to got the SharePoint, Lync or Exchange admin pages I now have to go to the Admin Center page first and then click "SharePoint", "Lync" or "Exchange".
  • So for me, no.

 

What should I call this?

image

As a trainer I have to document steps, and tell people where to click. This button does not even have a mouse-over tip to explain it's purpose.

Using the F12 tools I found this HTML:

<button class="o365cs-nav-item o365cs-nav-button o365cs-navMenuButton ms-bgc-tdr-h o365button ms-bgc-tp"
id="O365_MainLink_NavMenu" role="menuitem" 
aria-label="Open the app launcher to access your Office 365 apps" type="button">

So I guess we can call it the "Main Link Nav Menu" or may be the "App Launcher button". Your guess is as good as mine.

Here is looks like it is called App Launcher.

 

What about your customizations?

Depends on how they were done. From here it sounds like your custom logo will be moved to the center of the Suite Bar.

 

.

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.