SharePoint 2016 more delicious with cinnaMINROLES; Now with FP1

13 06 2017

If you have been following Dojo for the last few weeks, you may have noticed that I have been riding the Sp2016 Ship lately. Not sure if that came across or not.

One of the most talked about new features in 2016 is the new MinRole topology. I could point you to the official Microsoft documentation, but instead, you should all go to Spencer Harbar’s blog. His indepth knowledge is quite invaluable.

So why MinRole you ask? 3 words…ZERO DOWNTIME PATCHING (maybe its 4?). Well, that’s the best thing for someone like me, but there are tons of other reasons why you want MinRoles. Spencer has 2 great articles that you should read before you continue here:

  1. http://www.harbar.net/archive/2016/04/04/SharePoint-2016-Nugget-1-Topology-Service-in-MinRole-Farms.aspx
  2. http://www.harbar.net/archive/2016/08/04/Zero-Down-Time-Patching-in-SharePoint-Server-2016.aspx

Ok, now that I am done brownosing that English dude, the reason for this post was to enlighten you on some not so obvious things, specifically around Feature Pack 1.

Feature Packs are like the new old Service Packs and they come in a few flavors:

  1. language independant
  2. language dependant

In November of 2016 Microsoft released the first Feature Pack for SharePoint 2016. You can read all about the cool new features it comes here : Feature Pack 1.

Today’s post is about MinRoles and the difference between pre and post FP1 topologies.

Before FP1 your minimum supported MinRole configuration had to be 4 SharePoint Servers:

  1. search
  2. application
  3. web front end
  4. distributed cache – yup, you heard right.

For High availability  you needed 8 servers:

  1. 2 search
  2. 2 applications
  3. 2 wfe
  4. 2 distributed cache…ugh

But, after FP1 that all changed as Microsoft introduced the concept of shared roles. This means you can now combine, application with search, distributed cache with front ends, and custom anything  you want.

The minimu supported MinRole config is now just 2 servers:

  1. application + search
  2. wfe + distributed cache.

For full HA all you need now are 4 SharePoint Servers.

  1. 2 app searches
  2. 2 WFE + Distributed Cache.

Not bad Microsfot, not bad at all!

Just thought I would let yall know. If you didn’t already. WHich you probably did, but just in case.

Nando





The Secret Of MIM: For SharePoint 2016

8 06 2017

I promised you some war stories, and damnit, I am sorry it took an extra day to write it. MIM is a worthy adversary and I neede to get some sleep.

For a quick recap visit: The Secret of MIM(2016). A Ballad of UPS.

Here is the current scenario:

Client has a SharePoint 2013 environment and is running UPS with both AD connections and Custom BCS connections.

To my absolute horror, AD was not the source of profile info. Not that it should, but its what most people expect.

Customer relies heavily on the UPS for a Staff Directory.
SP UPS is the source of truth for custom employee info like, cellphone, skills, languages, interests, etc.

The project is to migrate from 2013 to 2016. Easy enough right? Nope. MIM 2016 is hard, until you figure out its easy.

Is started by installing and configuring MIM based on this nice post Configure MIM by Mr WAQAS.

Simple enough right? Nope. Turns out I had installed MIM 2016 with SP1. So I had some additional work to do. I should have just listened to this man: Spencer Harbar. But being the SharePoint warrior (read idiot), I didn’t.

When you use the MIMSnyc toolkit” for SharePoint 2016, with MIM SP1 upi need to update the module. If you click Spencers name uptop it will take you to the very article you need.

If you are lazy and just want to read this then here is what you do.

  1. Download MIMSync from Github  MIMSYNC 2016.
  2. Crack open the SharePoint PSM1 module in edit mode (make sure you open as admin)
  3. Edit lines 80-97 so it shows new version of MIM like so:MIM
  4. Save that and follow the instructions on how to sync with MIM. Step By Step MIM
    1. GOLDEN NUGGENT ADVICE 1 – MIMSYNC LOVES THE C DRIVE SO BE CAREFUL. I INSTALLED ON THE C DRIVE JUST TO BE SAFE.
  5. If you followed all the instructions and didn’t mess up like I did, you should have a fully synchronized UPS with MIM.
  6. If you did screw it up or you want to add custom attributes read on.

So you screwed up.

How do you fix MIM? This is the REAL sceret of MIM. There are tiny little nuances that you need to know about and MR Spencer Harbar, has uncovered this for us in his MIM webinar (which is 2 hours long. i love me a british accent so I sat there and took it). But if you don’t have time here is the condenced sequence of events that need to happen.

GOLDEN NUGGET OF ADVICE 2: MIM LOVES, LOVES TO DO THINGS IN A SPECIFIC ORDER.

First here is the order of things you need to follow to create a new Custom Property:

  1. Create the New User profile Property in the User Profile Service
  2. Create a matching property in the Metaverse Designer
  3. Map the Custom Property in the ADMA
  4. Refresh the Schema for SPMA
  5. Map the Custom Property in the SPMA
  6. Run Full Sync

There are a few different ways to do the above, but Spencers way is the best. He created custom run profile for Full Import and Full Sync. Check out his webinar The MIM BIBLE.

So I did all that. I saw the attribute in the Synchronization Statics, but it damn it Jim! it doesn’t show up in SharePoint User Profile (hair pulling ensues).

See, what had happened is that when I created the new attribute, it also wanted to create a metadata term for that attribute (location is a good example). BUT, guess what? The darned termset was set to closed by default!!!!

Who would know that? Well, Spencer does. So that is why I watched the whole thing.

GOLDEN NUGGET ADVICE 3: IF YOU WANT YOUR CUSTOM ATTRIBUTE TO BE SEARCHABLE, YOU NEED TO CREATE CHECK , CONFIGURE A TERM TO BE USED FOR THIS PROPERTY CHECK BOX, WHEN YOU CREATE THE ATTRIBUTE IN SP, BUT YOU NEED TO MAKE SURE THAT THE TERMSET IS SET TO OPEN IN THE TERM STORE. TERM

BUT THAT’S NOT ENOUGH. YOU ALREADY RAN THE FULL SYNC. SO WHAT DO YOU DO NOW?

GOLDEN NUGGET OF ADVICE 4 – THIS IS THE BIG ONE! TO FIX IT ALL YOU NEED TO CLICK ON THE SPMA MANAGEMENT AGENT IN MIM AND CLICK DELETE AND SELECT DELETE CONNECTOR SPACE ONLY!

DEL

I wrote that in caps in order to drive home the point that this needs to be done. That, my friends is the real secret of MIM.

If you screw up, you need to delete connector space only so you can continue to work.

Phew…that was a lot. Learn from my fail. Once you master this, MIM will be your friend. If it’s not then, contact me and  I will see if i can help. IF i can’t I will refer you to the master.

If Todd is reading this, feel free to make any necessary corrections. I may have screwed up somewhere else.

Sincerely,

Battle Tested Nando.

 

 





Email Enabled Calculated Fields

10 05 2017

I am back! Today I am going to show you how to use calculated fields to form an email address and a clickable link to send to that email address you just created.
The ask was to create a custom list that had the following fields:
Cost Code
Address
Location City
State
Phone
Manager
This information just happened to be avaialable in another SQL database, so rather than populate it it manually, I decided to go BCS all over that sucker. BUt, that’s not what we will talk about today.
Once that information is safely in SharePoint via external contentype, I used 2 calculated columns to get the email and the mailto link.
The first calculated column was used to concatenate the cost center and location to form the much needed address. So if you are following at home create 2 calculated columns.
The first colum will take Cost Code and Location city, mash them together and spit out an email address the address in the following format store40001portland@mystore.com
Since i have no column named store, i will just hard code it in. Here is the email formula:
=CONCATENATE(“STORE”,[Cost Center],Location_City,”@mystore.COM”)

Now, to make it a clickable mailto link, i really had to mess with the html. For your second calc column add this formula:
=CONCATENATE(“Email“)

You guessed it, EMAILCALC is the name of the first calc column.
that’s it.
Love me.
Nando





Buttons, Buttons, Buttons.How to create a Sp 2013 Javascript button to create a new doc

6 04 2016

You know what’s not so easy in Sp2013? Newform.aspx urls. Sure they live in the document library ribbon.
Sure you can also just drag stuff in, but what if you want to create a custom page and make it even easier for your users to create a new document?
That’s not so easy. So i set about figuring out the best way to do this.
Javascript buttons look cool and professional, so I thought, hey why not.
So I scoured the interwebs for some code. I came across this Gem by Ahmed Farag:
https://blogs.msdn.microsoft.com/how24/2014/09/23/create-a-link-to-display-edit-and-create-new-items-from-a-dialog-layover-in-sharepoint/
Thanks Ahmed you got me started!
This is an elegant solution if your library is out of the box. But what if you have custom content types?
That is not so easy to figure out. Once i did figure it out it was easy but not at first. You see, if you add a custom content type to a document library, the content type lives in _layouts, not in list/library name.
So how do you link that?
Well my friends, I am glad you asked.
First things first, like Ahmed says, grab yourself a content editor webpart (not script editor, that one has issues) and add it to a page.

Open your fav notepad editor
Copy Mr. Farag’s elegant code into it and click save.

 

(script type="text/javascript")
 function displayLayover(url) { 
 var options = SP.UI.$create_DialogOptions(); 
 options.url = url; 
 options.dialogReturnValueCallback = Function.createDelegate( 
 null, null); 
 SP.UI.ModalDialog.showModalDialog(options); 
 } 
 (/script)
Upload to your site asset library and link it via web part editor propeties
Now you have a pretty nifty button, but it doesn't do anything.
According to Ahmed, you should add the HREF key after your code for newitem.aspx.
However, as I alluded to early, that's not going to fly if you have a custom content type.
So here is his code:
<a href='javascript:displayLayover("/Lists/Contacts/NewForm.aspx?IsDlg=1")'>Display Item </a>
As you will figure out, content types do not live in /list/, they live in _layouts. So, how do i get that darn URL?

Its actually stupid simple. 
Basically, all you have to do navigate to your library settings, advanced settings, and find the open forms in dialogue, and click no.
Go back to your library and click new document and select your custom content type.

That will open your new item in a page, where, gasp, you can copy the url and past it into Ahmed code.

<a href='javascript:displayLayover("http://mysharepoint.domain.com/_layouts/15/NewDocSet.aspx?List=bc691a02%2D6335%2D4aee%2Da0e8%2D70185ab0491e&Source=http%3A%2F%2site%2Edomain%2Edomain%2Ecom%2F15%2Fnewlibrary%2FForms%2FAllItems%2Easpx&ContentTypeId=0x0120D520006B5814CAEDD0FD4C8F8F5C6B8AD7978C00F45CB6B8B2D5A74C8046CA70881BB0F7&RootFolder=%2F15%2Fputthisinyournewlibrary")'>New Content Type </a>

That's it. Now you have a new button that creates your new content type.

Tips: Make sure when you use content editor you upload your code to the asset library and link the file inside the content editor, so you can edit it easier.

TIP: Turn on versioning in your asset library so you can version your code out.

 

You are welcome world!

Nando





SharePoint 2016 is out!

24 08 2015

So excited to announce that the Tech Preview for SharePoint 2016 is out today. Read all about it, here
https://blogs.office.com/2015/04/16/sharepoint-server-2016-update/
This link includes the link to the download as well. Scroll down to the bottom.
So much cool geek stuff in this tech preview to talk about. I will be updating the Dojo when i get my VM running at home.
Also, there is an AZURE SharePoint 2016 offering coming this week. Stay tuned for details.
I am off to install it. Will post later.

Nando