About the Author
Author

stoff

Check If Connected to SPOService in Script

SCENARIO
When executing SharePoint Online scripts you need to be connected to your “admin” site or the script will just fail if you’re not.

PROBLEM
When writing a script you can’t assume that you’re already connected to your SPO tenant and unlike the “msolservice” connect call you need to specify your “admin” URL which can be quite long. But sometimes you’re already connected in the Powershell session.

SOLUTION
Writing this little thing in the start of your script will check if you’re connected to the admin site and if not will call the connect-sposervice command with the URL already set.

Issues changing ImmutableID with error FederatedUser.SourceAnchor

Recently ran into an issue where a user in the on-prem AD had been deleted unintentionally and in the next sync his user went along with his mailbox.
Googling around I found a helpful article how to best go about restoring this. It’s basically about creating a new on-prem users and setting the new GUID on the recovered AzureAD user so AzureAD Connect can tie them together.
However, when trying to set the new “ImmutableID” with “set-msoluser” I got this error:
Set-MsolUser : You must provide a required property: Parameter name: FederatedUser.SourceAnchor

Took alot of Googling to realise what was wrong! The issue here is that you can’t set a new ImmutableID on a user in a Federated domain! So the trick here was to change the user to an “onmicrosoft” user, change the ImmutableID and then changing it back to the federated domain!

Hope that saves someone some headache.

Heatwave – I wonder what might’ve caused it…

We’re having a major heatwave here in Sweden, so bad that even Pokemon Go are alerting me about it! I’ve heard it’s been the same a little all over the planet. And this reminds me of something that’s been on my mind ever since physics in college when we were discussing energy and how it can’t be created or destroyed, it can only be converted from one form to another. And this made me go around thinking how different things convert energy and it didn’t take too long to realise that so incredibly much of today’s society relies on stuff that converts energy to heat!

I mean, even if we disregard the entire greenhouse effect caused by gases, today’s society relies so much on things that create heat as a bi-product that we really can’t be too surprised when we get heatwaves like this. Nuclear power plants creates so much heat they need gazillion gallons of water to cool it, driving your car creates heat both in your car and the asphalt, using your computer creates heat, running your fridge and freezer creates heat, running the train creates heat, running your air conditioning unit to keep cool creates heat, most of the stuff we use today create heat – even your cellphone! And then there’s the fact that every single person is a walking radiator stuck at 37′ and now there are like 10 billion of us?

So yeah, I remember Trump’s tweet about how that cold day in Manhattan was proof there was no global warming – well this is most definitely proof that it’s a thing 🙂

Too Old For Concerts !!

Me and the wife celebrated 10 years a few months back. And one of the things I had planned was going to see Ed Sheeran in Stockholm since she likes his music and the timing was pretty good. So I made sure to be there when tickets went up for sale last year and got two tickets and last Saturday was the day of the concert. And the result was … we’re too old for this!!

First of all, entry was at 6:30. I made jokes “the guy probably isn’t gonna go on until 9!”. I was wrong – he went up about 8:40 so off by 20 minutes. So spending 2 hours listening to pre-show / opening stuff is “as intended” I guess? And whoever organised the event should have planned a bit better and planned for the roof to be open for the event as it’s July!! The temperature was about 35 degrees in there by the end of the night. And after the concert there was a traffic mayhem to get out of there because they had blocked off most streets which congested everything. So instead of the usual 20 minutes from MoS -> home it took us about 1 1/2 hours.
“Well, what about the show itself”? .. well I’m not a big fan of his, even though I enjoy some of his songs and lyrics. I compared it to going to the movies to see a romantic comedy – It’s wouldn’t be my first choice, but I’ll do it with the wife and I’m bound to get at least some enjoyment out of it! But this show was really different than what I expected. The guy even tried rapping a few times! And no sign of Supermarket Flowers either.

But my biggest issue was the volume. I know, I know, concerts are loud. But this was way well beyond “loud”. I already have tinnitus on my right ear thanks to me underestimating the volume at a Röyksopp / Moby concert back in 2002. So I made sure to buy earplugs before the concert to try to make sure that didn’t happen again. And my ear is still ringing!! I honestly don’t get where the enjoyment is when the music is so loud it hurts my ears even with earplugs !? Yes, you want to feel the bass in your chest but I get that from my home cinema that never gave me a ringing in my ear! It just makes no sense!! Even in between songs when he was talking it was so loud I couldn’t hear what he was saying half the time. And this is completely accepted and expected today!? I really don’t get it!!!

The one good thing I can say is I was impressed that he handled the stage alone in front of 50 000 people superbly and his way of creating musical loops with his pedals was quite funny and unexpected. And I liked it!

What MFA method is used by how many users

SCENARIO
You want to know how many users are using SMS for MFA or mobile app to change user behavior to drive adoption of the MFA app.

PROBLEM
By default when users enrol with MFA they click “Next” all the way and end up with SMS authentication, regardless of what information we provide them with. And the way Microsoft stores this information isn’t very friendly for us to see this easily.

SOLUTION
I wrote this to demonstrate to management that users indeed doesn’t read the e-mails sent out to them which detailed that they should use “Mobile app” verification and what actually happened was they just clicked “Next” all the way and ended up with SMS authentication. In our case we ended up with about 2% of users chosing the application!

SharePoint Upgrade From Hell

This is going to be a wall of text. And 99% of the people I know aren’t even interested. But I’m writing this on behalf of every other SharePoint admin out there who are unfortunate enough to discover just how easy SharePoint is to break!

Little background: I’ve been working with SharePoint since about 2005. Not that long for some but long enough to know that after a few years of use a SharePoint farm has a few quirks in it and it’s a good idea to upgrade it. And you never upgrade an existing farm, you always start with a new fresh one and import all data! Now one of my jobs (!) is managing a 30k user corporate SharePoint – a business critical solution since all documentation are in there. And not only that, our entire BI solution is in there as well, complete with “PowerPivot” and “Reporting Services for SharePoint”… No pressure!

So now it was time to upgrade it from SP2013/SQL2014 to SP2016/SQL2016, including all BI solutions. We’ve gone through a “dev” environment, a “test” environment and even a “preprod” environment and everything went surprisingly well. There was ofcourse the usual glitches getting the BI features to work (and the S2S cert trust that is required for Excel with data source connection files now that Excel service moved out of SP to OOS!). But anyway, the preprod farm was so great that the plan was to take it into production. Our BI team didn’t see a big problem doing that in an afternoon on a weekday, whereas for me the biggest problem was the 1.5TB of data that needed to be shuffled and upgraded. And “even the best laid plans”, you know. I also knew that one of the biggest issue was network infrastructure which for a global company is so complex that the best way forward was to swap IP addresses of the servers so we wouldn’t have to change DNS or static IP routes anywhere, we’d just solve it at the load balancer level. So I managed to get a whole Saturday from the business to have SharePoint offline, but no more. After all, all documentation is in there!

That Saturday was last Saturday April 14th. I got up at 4am to start shuffling the data. By 7 that was done and I started upgrading the database with the normal “mount-spcontentdatabase”. Here was my first mistake (in hindsight). I had already written a script to do this, but that’ll come later. By 10 everything was loaded, upgraded and I proceeded to change IP addresses around and change it in the load balancer, then go through my long list of checks that normal user SP functionality works while our BI team were updating all of their things.

After lunch we had a “go/no-go” meeting and everything looked good. I also noticed at this point I had a case to create a new SharePoint site for a project, something I actually hadn’t tested since that’s not a “normal user SP functionality”. And that’s when the shit hit the fan! What I had missed thanks to my scripting was that one of the content databases had failed to upgraded and was now corrupt and when I wanted to create a new site it did it in that database since it was the “least used” and hence the error. “No problem, plan a) I’ll just delete this database”, right? Nope, SharePoint wouldn’t have it because the database wasn’t attached since it was corrupt. Yet I could see the sites in that database listed with get-spsite?

Tried a few things but couldn’t recover so I decided plan b) remove the web app and create a new and re-import/re-mount this corrupt DB, all other DB’s were already upgraded successfully so not a big operation. Well, SharePoint wouldn’t have that either – it couldn’t dismount this database because it was corrupt so I couldn’t remove the webapp! I was completely stuck with a broken web app that I couldn’t remove because of a content database that wasn’t mounted?!

So plan C) rename that webapp with the corrupt database and give it a nonsense URL so I could create a new web app with the proper URL. That seemed to work but when I tried importing a new backup of this content DB it didn’t import any of the site collections! .. digging around I could see that the sites in the broken webapp, with the new nonsense URL, still had the original URL! It couldn’t update them because… there was no content DB attached to them! I dug around in SharePoint Manager (which was designed for 2013 I know) but it kept crashing when I clicked any of the sites in the broken webapp.

So there I was with a broken web app with a corrupt contentdb with sites occupying the URL I needed to create our proper web app. Came to the conclusion that the config db was pretty much fucked at this point at now we’re at 2pm. Best option available to me at this point was calling Microsoft premiere support case with a severity A case. I’m pretty sure if I had gone for that they would have looked at it, made the same determination as me and said “since this is a farm not yet in production, I’d say the best way forward is to recreate the farm”. During that time our BI would be in SharePoint 2016 but the “big” web app in 2013 on separate IP addresses! God knows how the network would handle that and getting the engineers in India to change firewall routes in less than a week wasn’t that likely. Because rebuilding a new farm in production would take at least a week, right?…


After clearing it with my supervisor that this was indeed the best way to solve it NOW! All other options led to some unknown hellhole – going back was always a possibility no matter what.

I got a green light and Red Bull at about 3pm …

 

  • SP Product Config Wizard to detach all server from the farm
  • delete all databases from SQL except all the (successfully) upgraded content DB’s
  • thank myself for having saved all of the “AutoSPInstaller” response files
  • create a dummy web app to upgrade the corrupt DB (no way I’m doing that in the proper web app again!)
  • eat the food my awesome wife brought me
  • recreate all webapps
  • restore all content DB at about 1.5TB
  • upgraded the service apps

Basically I had done at least a weeks work in 7 hours and all in production environment!

The “Done!” mail got out at 9pm! Now I’m not one to brag, but any SharePoint admin must be impressed by that! Hell, even Scotty would be proud! I spent a few hours on Sunday cleaning up the mess and sorting out the BI issues (since this was a new farm there were a lot of BI configuration that was lost) but by Sunday 6pm everything was fully operational and I promptly went to be and slept like a baby. And one of the first things to hit me on Monday morning was “why is Managed Metadata empty” because yeah, in my haste I forgot that little thing 🙂

How was your weekend?

It’s Been 10 Years!!

It’s been 10 years since me and my wife met. It’s been an unexpected ride that I’m incredibly happy I took a chance on!

Wind back the clock about 10 years and I was living very happily alone (but not lonely!) in my apartment in Visättra. My life was computer games (mostly WoW), movies, TV, F1 and my family in Nynäshamn. And the job at the lawfirm. Everything was great and I didn’t feel like I needed a girlfriend or live with some other person, I had way too many “special” habits to live with another person for long especially a girl. But I was still signed up to some dating sites and had the odd date or two. But then a mail dropped in through Parship from this chick who I just loved the way she wrote and expressed herself, she was funny, she was honest and open and the “straight to the point” kind of person I can really dig. So we set a date after work, hooked up and just walked around in Stockholm for a while, only stopping quickly to grab a coffee. Then I tried kissing her goodbye (DENIED!) and off she went. But I felt and knew this was something special so when I got home that night I ordered her flowers. Nice and romantic right? It was my way of saying “I don’t mind getting turned down for a kiss, I really dig you and I wanna meet again”. Little did I consider the fact that she works in “logistics”, which is a very male dominated area so when her male co-workers saw she got flowers the day after she’d been on a first date they jumped to conclusions! Anyway, a few days later she decided (without telling me!) to test how allergic I was to her cats by inviting me home to her place! Fortunately for me it wasn’t a big problem and after passing that test we went to see a terrible movie (“Jumper”) and made out a bit. And then we met a a few days a week but eventually I felt it was “do or die” and moved in with her after only 6 months. Yeah, I know, crazy but that’s how perfect this relationship felt. And 4 months after that we signed on for a house together. And 3 months after that we were pregnant. And the hits kept on coming!

It’s been a few lows here and there but as I see this has gone way better than I could have hoped for and I can just hope it keeps going that way because I’m having a blast!

Last weekend we had booked a room at the B&B at “Kastellet” at Vaxholm. That’s an old fortress on a very small island. It was used to fend off invaders in the archipelago but now it’s mostly a tourist site. But because of the extreme weather we had in Sweden last week there wasn’t anyone there during the weekend. At all! Not even the staff who had given us the code and put out the key for us for a room. So we had the entire place to ourselves! And it was absolutely amazing!!

So here’s hoping for another awesome 10,20, 30 or even 40 years!!

NASA. Again.

K mår bättre än bra

Yeah, I don’t know why but NASA has a special place in my heart. Maybe cause I’m a tech nerd, a scifi geek or just like to have my shit together, or maybe it’s some visionary part of me I don’t know I have but I just love it. In everything from fictional NASA in “Contact” to proper NASA in “From the Earth to the Moon” it’s an inspiration. That’s one of the reasons I made a point at going to Kennedy Space Centre when I was in Florida and one of the reasons that trip was an awesome success to me. And one of the reasons I didn’t have a problem opening up my wallet in the gift shop!

And yesterday I saw the movie/documentary “Mission Control” – about those 20-something engineers that made up the mission control team. I really recommend catching it on Netflix or renting it on bluray cause it’s awesome. One of the things that surprised me was the interview with one of the engineers who was there in the trench for a lot of the Apollo missions, even the moon landing, that said he regretted doing it because of the toll it took on his family! I mean, it’s one of the things I can only dream of doing so hearing that makes you wonder what really is important – making a mark in history or being with your family.

Another NASA “merchandise” I can recommend is the book “View From Above” by austronaut and “photographer in space” Terry Virts. You can get it from Amazon or something but it’s well worth it. Not only because of the awesome pictures that makes you feel tiny and insignificant but also because of the stories he has to tell.

Manage External Sharing in SharePoint Online

SCENARIO
You’re managing a SharePoint Online environment and you want to know where external sharing is enabled.

PROBLEM
The problem is that Microsoft hasn’t fully launched a way of getting a good overview of this where you can change it. When you first enable sharing for example alot of sites will have it turned on by default etc. The new SharePoint Admin center has the ability to add the “external sharing on/off” column in the list of sites but that is very limited and you can’t enable or disabled it.

SOLUTION
Fortunately there is a very good attribute that you can retrive to get this and alter the external sharing setting called “SharingCapability”.
So using that you can get a list of all sites and what the status is of them, or you can filter for all that have it enabled or disabled:

Once you have that you can script it so you can disabled external sharing on all sites by doing this:

The reason you want to do this in a “foreach” is there will be a site or two you may get an error that you can’t change the setting, so that would exit the command on that error.

Being a Gamer Sucks Right Now. Hard!

How can I make that statement this of all years, when the best Assasins Creed “in years” launched, best “Star Wars” game ever, sequal to “Shadow of Mordor”, a WWII “Call of Duty” and oh so many other great titles come out!? Well, bare with me…

You know I’ve always been a gamer, right? Ever since my dad dragged home the first “portable” computer in the 80’s and we were playing that terrible olympic Decathlon game, through the Commodore series (VIC20 -> C64 -> Amiga) all the way up till now, I’ve always played computer games. Never been much for consoles though but that’s a different story. And playing games have been pretty much the same for most of that time. But when “World of Warcraft” launched back in 2004 it was… a subscription!? $60 to buy the game plus $10 per month!? Well they pushed out content on content so I thought that was ok. Think I paid about $1300 for “World of Warcraft” all in all. That was for over 10 years of entertainment, pretty sweet deal if you ask me!

And being a Blizzard fanboy I’ve gone through their “Heroes of the Storm” and “Overwatch” too. One thing I never really liked about those games was the lootboxes. I didn’t mind it much, I even bought a HotS lootbox pack once, but I can’t say I liked it. But in Overwatch it was always just skins which made it more ok than in HotS when it was actual characters you needed. But I never actually bought HotS for $60 so still fine (I’ll give them a pass on the D3 AH because they took it down and said “our bad”). Then there’s been “gold edition” of games and DLC packs and stuff like that that ads value over time, but it’s always been optional.

But now it’s just getting a bit much. Like most other gamers out there I am so very frustrated at the new schemes coming out of Ubisoft, Activision and most of all EA. Ubisoft has had “cosmetic” items for purchase a while for both “Assasins Creed” and “Division” but nothing more than that. Now it’s changing and it’s affecting gameplay! The most recent and extreme example of this is Battlefront II. With their way of pushing lootboxes on consumers I absolutely won’t be paying $60 for that game! Maybe I’ll pick it up next year on Black Friday sale, I dunno, but paying $60 for game where I have to grind grind and grind to even play characters that should be there out of the box?! Or you can buy lootboxes for more money! Really!? And then EA releases Need for Speed with… “speedcards” that you can fast-progress by buying lootboxes! Another game I was absolutely planning to already be playing was the new Mordor game (“Shadow of War”). But oh no, they had to go ruin that game too with in game store to buy Orcs. Yeah, buy Orcs in a game for real money!

And they even have the balls to call it “microtransaction”, you know like the “micrtransaction” for a Android app that cost like $1? No, because here we’re talking about getting 20 lootboxes for $60 – as much as the f*cking game costs! And don’t come with any “but games have been $60 for ages now!” because yeah, they have, and have the profit of any publisher gone down because of that? No, they’ve made more and more money every year! Look at “Cuphead” that cost like $20 which is turning out to be one of the best games all year! No, games don’t have to cost $100 million to make! You don’t have the PR push it that bad if it’s good enough, you don’t have to have 1000 song in the music library like GTA!!

What makes this even worse is that in some of these cases you’re not even buying the thing you want – your paying FOR A CHANCE at the thing you want! You may get the Orc you want, but you may end up with nothing. You may get the power up for your Heavy stormtrooper, or you might get a silly emote! It’s gambling and feeding on addiction and it’s loathsome and everyone should be ashamed of it. I know I am and I’m not even buying or playing those games! The irony is that Battlefront 2 is made by DICE – a Swedish studio. And the government in Sweden are pretty strict when it comes to gambling. Pretty strict as in “only government run gambling is allowed!”. Yeah, someone should maybe look into this! (and not the ESRB, that’s like Donald Trump saying his son is a good person!)

The last game I bought was Assasins Creed Origin which came out a few weeks ago. And so far I haven’t run into much lootboxes or “pay to get this über gear” yet, if you don’t count the gold edition addons. But looking at the horizon, I have no idea what I’m actually willing to buy even though there are plenty of games I should love to buy and play but my moral compass really gets in the way.

Fortunately people are rising up and raging against the machine. Just youtube “lootboxes” and you’ll find tons of videos on the topic. Or you may have seen the news that EA’s reply on reddit regarding Battlefront 2 progression is the most “thumbs down” comment ever on reddit?

How many has what Exchange storage limit?

SCENARIO
You’re asked how many users has what storage quota/limit in Exchange

PROBLEM
The problem originates from MS saying that the standard Exchange Online mailbox is 100GB in size. But some of our users are reporting they “only” have 50. I thought this was a minority if people so not a big thing. My manager disagrees.

SOLUTION
I began writing quite a complicated powershell for this but when I looked at it after a coffee break I said to myself “there’s gotta be a better way”. And sure enough it is. I’ve simply never used the “group-objects” function before! But now I can clearly get a report that’s just 3 lines long!

Microsoft Ignite Conference

Lobby of OCCC South

The whole reason I went to the US was to attend the Microsoft Ignite conference. It’s an annual conference Microsoft has where they reveal a lot of new stuff they are either launching or working on and have sessions and workshops. Our company sends 2-3 people to that conference but since the ticket, hotel and flight (not to mention the time from doing actual work) the cost goes up quite a lot for the company. This year I got to go for the first time as kind of reward for good working migrating to Exchange Online. My cloud-colleague Michael also got to go but unlike me he knew some Swedish consultants that were also going so we could hang with them when we’re not at the actual conference. After an initial scare it was going to be called off thanks to Hurrican Irma we were ready to go!

And it really was fortunate that we were the ones to go since sooooo many of the sessions and talk was about Office 365, Azure and the cloud! It was really hard to find sessions that talked about on premises stuff but I managed to go to a few! The event started officially on Monday morning with a vision keynote by Satya, the CEO of Microsoft and had a bit of this and that in it.

Trying to get the new about OneDrive

After that it was a technical keynote of the digital workplace and then it was just one “breakout” session after another. I think I attended a total of 20 sessions in total and almost got overloaded with information. I used my cellphone to take photos of some presentation slides to remember what that session was about and what we’d covered in what sessions!

Another great thing about these events is that you meet the people who are actually working on the other side – when I’m freaking out over the bad SharePoint Online admin center “well that guy right over there is the program manager of that, go talk to him”. Which I did. “Well you’ll glad to know we’re working on version 2, mail us and we’ll get you into the preview”. Done and done! And seeing some really pros at doing presentations, like Anne Michels who constantly made jokes on her expense (and sometimes even Mr. Michels).

And on Thursday evening Microsoft had “rented” the entire Universal Studios Orlando theme park for us! All you can eat, drink and ride all evening long! That was certainly an experience since we don’t have anything close to these theme parks in Sweden! We have plenty of amusement parks, but no theme parks, certainly not like this where you can walk into Jurassic Park and have a dinoburger!

Then friday was kind of winding down and collecting thoughts and writing reports on what I’ve learnt and then on Saturday the long trek back to Stockholm began. I checked in at the airport at about 2pm on Saturday and passed through customs in Stockholm at about 1pm on the Sunday.

But all in all it was an absolutely awesome experience and conference to attend for me. The downside was of course being away from my family for 8 days, that really felt long in the end. My and the wife have never been away from each other for that long since we moved in together 8 years ago!

Visiting Kennedy Space Center

KFC monument för JFK

I’ve always been a NASA-fanboy. I’m the guy that won’t ever say no to seeing Apollo 13 for the 500th time, or will sit through “From the Earth to the Moon” over and over again. And as a Trekker I’m loving the “exploration” theme and drive over there. The very human need for exploration and need to know what’s out there. So when I planned the trip, going to Kennedy Space Center was one of the musts. Fortunately my traveling companion Michael shared that need so along with a few fellow IT nerds we rented two cars and sat out to drive over there.

SpaceX byggnad & launchpad

We went on the “explorer tour” which gave us a trip around the cape and the launch sites of missions past but also the SpaceX stuff going on there now. We had a great tourguide Kurt who was totally right man for the job! Perfect amount of geekiness but also wanting to share that geekiness everywhere. He was amazing!

After that 2 hour ride we were dropped of a the Saturn station (or whatever it was called) which was just this huge museum for the Apollo program! I completely geeked out there, running around photographing every mission banner there was and every little thing! After a quick lunch we set off back to the Visitor center where they had a Atlantis museum which was an awesome 3-stage display climaxing in a reveal of the actual space shuttle Atlantis! Completely geeked out again! Like a kid in a candy store on Christmas!! Then it got really emotional! I still don’t know why I get all somber up and even tear up at it, but at the end of the exhibit was the Challenger and Columbia memorials.

We spent a total of 7 hours there and I could’ve stayed a while longer! Absolutely one of the best experiences of my life. My only regret is that my wife and son wasn’t there to share it or see me get that excited about it.

Then we went to what these IT nerds who have been here a few times before thought was the greatest steakhouse ever – Morton’s. To sum it up and as my wife could say – I could’ve done more for less. I mean, it wasn’t bad, it just wasn’t all that and it was a pretty pretentious restaurant. But at least the company was good.

All in all a really great day!!

Coming to America

If you’ve followed this blog long enough or have heard me ranting you may know I’m not that big of a fan of US of A. And not only because of their most recent choice of president although that hasn’t helped. But a few months ago my supervisor asked me if I wanted to go to Microsoft Ignite. If you don’t know what it is, it’s a huge convention that Microsoft holds once a year in USA. It’s their greatest week of the year when they release a lot of new stuff for our techies and declares their visions for the future.

At first I didn’t know if I even wanted to go since it would mean actually going to the US. The only time I’ve been here before was when I went to Guatemala and had to pass security when going from one international terminal to another so I’ve never actually sat foot on their soil. But much like 14 years ago when I was asked to work on the project for the state department my initial feeling was “I don’t want to leave my comfort zone”. But realizing that.. I had to accept! After making sure my wife was OK with it I signed up. Fortunately a colleague of mine is also attending so I won’t be alone. And he has a lot of friends in the consultancy business so we’ll be hanging out with them. And there’s always the big “Swedes only” party to go to.

Orange County Convention Center in Orlando, Florida

Then hurricane season began and when I saw the footage on CNN from Orlando, where the convention is happening, it made me doubt they could pull it off, getting all stuff ready for a convention of this size in less than 2 weeks. Fortunately that wasn’t a problem and MS announced well in time that everything was good to go.

So on Saturday my wife dropped me off at Arlanda, we kissed good bye and I went off through security checkpoint to start my journey… and flight delayed!! Some part of the plane broke and they had to fly in a new one from Copenhagen (which I believe is airliner talk for “the crew wasn’t allowed to fly anymore because if union rules and we had to fly in a replacement crew). So about 3 hours later (plus one free beer!) we lifted of for Newark airport at New York. After passing through security, customs, security, passport check, customs, security and a tram between the terminals we arrived at the new gate with about 2 hours to spare. We were supposed to have a 6 hour wait, but 3 hours late departure plus all those lines meant we only got 2. And that was plenty because unfortunately Newark airport is something out of the 70’s. It really does need a fix up! Then we went for a bite to eat but when I went to the food court I got this familiar smell of deep fry oil from my days working at a fast food restaurant so my heart told my body I don’t want to eat here. So I didn’t. Fortunately my metabolism goes down, way down, on airplanes to it really wasn’t a problem!

The New York skyline, all the way from Newark

Then onto that airplane that was gonna take us to Orlando in Florida. And when we were supposed to lift off we hadn’t even left the gate yet. The captain announced they had to reboot the plane! I shit you not, it was a literal “have you tried turning it off and on again”-moment!! But it actually worked and off we went. Slept all the way!

After arriving something happened that has never happened in all my travels – my luggage was already waiting for me!! I think there was a mixup in Newark and the flew my baggage out on the flight 2 hours before ours, which goes totally against international regulations of not allowing a bag onto the plane without it’s owner! But I didn’t complain, we went out to grab a cab… and no! Not a cab in sight! Another first for all of my travels, an airport with no cabs! We only had to wait 15-20 minutes for one but they are usually lined up!

So, off to the hotel and sleep ahead of the new days travel to Kennedy Space Center. I’m hoping I’ll get to post about that soon, but I’m actually here to work so not sure when I’ll have the time for that!

SharePoint 2016 Installation Errors

SCENARIO
You’re trying to install SharePoint 2016 on a Windows 2016 server and thinks just aren’t going well.

PROBLEM
To be honest I don’t know how else to explain the problem in any other way than Microsoft’s Windows Server 2016 team was in a feud over lunchboxes with the SharePoint 2016 devs because there is no other way to describe the complete incompatibility between the two!

SOLUTION
I’d say “Google it!” but that’s probably what got you here in the first place!
The first problem is the prerequisite installer that can’t configure Windows IIS role or download things. Fret not for there is plenty of help to find. When first running the prereq you’ll probably get this error: “Web Server (IIS) Role: configuration error”. To configure the IIS use this Powershell :

Make sure to edit the source file to the Windows Server 2016 ISO!

The next place you should look at is this blog by the Microsoft Field Engineer Nik. Although be careful about some of his links as those are outdated and replaced with new versions, although downloading the version he’s linking will still work. He even provides a script that will run the Powershell to configure everything. Why this isn’t on the SharePoint 2016 ISO is beyond me!
But even when downloading all of that and installing it properly I was still faced with this error when trying to setup the farm: “New-SPConfigurationDatabase : One or more types failed to load. Please refer to the upgrade log for more details.“. Going through the install log I found this: “SharePoint Foundation Upgrade SPSiteWssSequence ajywy ERROR Exception: Could not load file or assembly ‘Microsoft.Data.OData, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bc3856cd365e35’ or one of its dependencies. The system cannot find the file specified.

It seems that the WCF prerequisite file when installed using the Powershell method of manually downloading and installing it! Fortunately the quick fix is to find the file “WcfDataServices.exe” in your profile directory (i.e NOT the one you downloaded!), running it and choosing “Repair”. Only then did SharePoint 2016 install properly!

Get Users With Multiple Licenses

SCENARIO
You’re managing a large O365 tenant and you want to make sure there are no users that have multiple licenses assigned.

PROBLEM
The original problem is that you actually can assign a user with a F1, E1 and E3 license and end up paying three times for a user! Next problem comes with how license information is stored and retrieved with Powershell.

SOLUTION
Here is little code that will read out all your users and go through each one to make sure they don’t have more than one of the licenses assigned. It should work as long as Microsoft doesn’t change the _actual_ names for licenses!

The script can ofcourse be enhanced to write a log or even mail a log to an admin if you want.

Check E-mail Addresses From File

SCENARIO
You’re handed a list of e-mail address for mass mailing from HR and they need to verify that all e-mail addresses are valid and won’t bounce “like last time”.

PROBLEM
There are a few problems with this. One is the fact that not all e-mail addresses are the primary e-mail address and won’t show up in a normal search.

SOLUTION
I put this little script together that will first connect to your MS Online tenant, then read all MSOL users into an array, import the CSV file containing the employees, go through each row and check that the e-mail address from the file in the column “employeeemailaddress” exists as a proxy address on at least one user. If not it writes out the e-mail to a log in c:\temp. Nothing too advanced, just a few things put together to achieve a very, VERY tedious task when you get a list of 10.000 e-mail addresses!

This can also be modified to check if any other attribute exists or not on users if you want to, it was just for this scenario that I had to check e-mail addresses! It can also be modified to read out the local AD and not the Azure AD, ofcourse.

Please comment out the first two lines if you run this more than once in a Powershell window since the list of users is already in the variable and reading out all MSOLUsers can take a very long time!

Valerian

I’m a huge fan of Luc Besson. Big fan! “Léon” is one of my favorite movies of all time! “Fifth Element” is right up there too. “Metro” is a classic, Nikita, Taxi, Big Blue, Transporter, Taken, Jean D’Arc, so many damn great movies! But he’s also done a few that I wasn’t a big fan of but can’t blame him for that 🙂

So when I saw the first trailer for “Valerian” I got really stoked! I mean really stoked. Like so stoked that I can’t even talk myself out of it, which I usually do because I hate going out of the movies disappointed.

I was not disappointed. It was awesome! I would like to give it all 5 elements but there were two things that put me off. 1) The translation to Sweden was bad. Yeah I know, I can’t hold Luc Besson responsible for that but I do hold the movie company responsible! Not that I need Swedish subtitles – but if you’re going to do it do it right, because this was terrible. 2) Dane DeHaan that plays the lead character didn’t feel right for the role. The character was supposed to have been in the military and seen stuff, like Korben Dallas in Fifth Element. Instead he looks and even acts like he’s the one that makes the other guys say “was I that young when I joined”! But apart from that – awesome! And yeah, SF Filmstaden Scandinavia delivers in VIP again!

What I was mostly impressed with was the CG and the visuals! They were absolutely amazing! It even got to the point were I didn’t know if it’s computer generated or if it was makeup or what was going on, I love that! Music was awesome, although missing that kick ass diva song!

So here’s hoping for more and judging by the amount of source material that shouldn’t be too hard 🙂

Get User With E-mail Address

SCENARIO
You’re getting some error that a specific e-mail address can’t be or send mails. But you have no clue about which user/mailbox is the owner of this specific e-mail address

PROBLEM
Most of the times this isn’t a problem, the Exchange Management Console or EOL Admin Center will do the trick. But sometimes it can be a bit tricky if the e-mail address is to say a public folder, which isn’t scoped in the search.

SOLUTION
This quick little powershell will do the trick for you to find it:

Credit goes to Fulgan @ ArsTechnia for the post here.

Enable Versioning On Entire SharePoint 2013 Application

SCENARIO
For some reason, probably money, you can’t use a proper backup solution for your farm. So you want to use versioning as a cheap mans backup.

PROBLEM
Going through every document library in every site in every site collection in every application to enable versioning isn’t possible. And there is no way to specify in Central Administration or declare a policy to enforce this.

SOLUTION
This powershell script will do the trick for you. It’s written to enabling versioning for an entire web application (with easy alteration it can be scoped to a specific site/site collection). What’s neat about this is that it will not change settings on the document libraries that already have it enabled! It will not enable minor versioning, but you can just enable that if you want.

As always, use on your own risk and test in a test environment first and then scope it to a test site collection in production farm!!

Credit goes to Amrita Talreja @ HCL for this post which is the basis for this Powershell script.