Creating training sessions & videos with MS Stream and OBS

In this article, I’ll go through the steps required to make a live event with MS Stream. Microsoft stream is a service included with Office 365 that allows organizations to have a centralized place for videos. You can have channels to organize content, and you can publish videos globally to everyone in the organization. You can also secure videos and target specific users by having videos specifically for Office 365 groups (and those groups can have video channels as well).​​ 

Another feature of MS Stream is its ability not only to upload and organize videos, but also holding live events. Those live events can vary in their purpose, either to broadcast a live event where someone would be speaking on a stage, or holding an interview with someone, or as simple as providing a video training for end users. The nice thing about these live events is that after they’re finished, you can save them along with other uploaded videos and tag them, so they can be discovered easily.​​ 

 

Let’s start with our use case, by first creating a group for SharePoint Training for our organization.​​ To begin with MS Stream, you can find it in the app launcher in Office 365, or you can go to​​  ​​ https://web.microsoftstream.com. On the landing page of MS Stream, you can find links in the top navigation bar to find your content or discover content created by other users. There’s also a​​ Create​​ button to create new content, let’s click it and choose Group.​​ 

I’ll just name the group: “SharePoint Training Videos”. In the group creation dialog, I’ll make the group as public, so anyone in the organization can find these videos, but I’ll turn off members contribution, so only admins can add content to this group.​​ 

Now, let’s start holding our first SharePoint training session for end users. Our goal is to provide them with training, and after that have this training session uploaded to this group, in a specific channel, and tagged with some tags to make it easy for them to find it later on.​​ 

 

Let’s try to create a new live event and let’s see what we’ll need to do. From the​​ Create​​ button in the top navigation, let’s choose “Live event”. We will be presented with a page to fill the live event information. I’ll name the event:​​ “Create a workflow for SharePoint with Flow”.​​ I’ll add the description as: “Use Microsoft #Flow to create a workflow in #SharePoint”. This way both​​ Flow​​ and​​ SharePoint​​ will be tagged and users searching for Flow or SharePoint​​ later​​ will be able to find this video. Next,​​ I’ll upload an image and choose a language. The language chosen will help later to build the transcript for the video, Microsoft​​ currently​​ supports both English and Spanish​​ languages​​ to build the transcripts.​​ 

Next choose the date of when this event will be held. The details section should look something like this:​​ 

 

Now click on the permissions section, and choose to save this video in “My groups”, in the textbox search for​​ SharePoint Training Videos​​ group we created earlier, and click on Create a channel:​​ 

 

Give the channel a name, for me I chose:​​ “Power Users Videos”,​​ and​​ provide​​ an image if you want, and click​​ Create. Now the video for this event will be added to the SharePoint Training Videos group, inside the Power Users channel. Finally click on​​ Publish event.​​ 

Now we’ve done the basic steps that are necessary​​ for​​ any live event.​​ Microsoft Stream works like any other platform, just like Youtube, Facebook and Twitch, they’re used as a server to host the stream, but you need a special program called Encoder to actually stream to this server.​​​​ Microsoft provides out of the box support for some Encoders, but you need to pay for them to be able to stream,​​ they’re listed in the​​ select encoder​​ dropdown list in the event page.​​ 

 

Most streamers use OBS which is a free open source program for live streaming used by majority of streamers, and it’d be nice if we can use the same program with MS Stream as well, for that we’ll choose​​ Configure manually​​ from the list of encoders.​​ 

 

Make sure to install OBS and start configuring it to work with MS Stream. Once you install OBS you’ll see a message like this:​​ 

 

Click No. In the bottom right section of OBS, click​​ Settings:​​ 

​​ 

In the Output section in the settings page, change the Streaming settings to be like the following:​​ 

 

In the audio settings, choose Sample Rate as 48khz.​​ Now the last step is in the Stream section. Change the dropdown list value to​​ Custom…​​ We need to get the server name from the live event page. Go back to the live event page,​​ click on Start setup in the live event page, and check the​​ Secure Connection (SSL),​​ and copy the server ingest URL:​​ 

 

 

Back to OBS, paste this url in the Server textbox, and for the key, it’s not needed by stream, but needed by OBS, so you can provide any random string, like YoStream.​​ 

Now OBS will need to have at least 2 sources to start the stream, video source and audio source. A source is something that can be used during the stream, like video, audio, view desktop, etc. We can add these sources from the​​ Sources​​ section​​ at bottom of the​​ OBS​​ landing page:​​ 

 

Click on the plus sign and choose​​ Audio Input Capture.​​ You can keep the default name as it​​ is and​​ choose the microphone device you wish to use for the stream.​​ Next choose​​ Video Capture Device, accept the default name and confirm. Finally click the plus sign and choose​​ Display Capture, then choose which screen you’d like to share in case you have multiple monitors. If at any point you need to change the screen to share, you can double click on the source in the sources​​ list and​​ change the settings.​​ Also,​​ you don’t need to actually turn on the video, it’s only required to stream, but you can turn it off by clicking on the visibility icon in the Sources list:​​ 

You can do the same thing with the Display Capture to turn off screen sharing.​​ 

Now you’re good to go, you only need to do these settings once, and they’ll be saved for the next time you wish to do a live event as they’re saved in the user settings with OBS.​​ 

 

Now in MS stream, if you click on Start Setup:​​ ​​ 

 

MS Stream will know that you have OBS Streaming running and will display a button for you to start the event. (If you don’t have OBS streaming running, it won’t be able to show you this option)

When you click Start event, you’ll go live​​ and users can see your event (or your desktop and hear you in this case).​​ 

Note that there’s a delay of one minute between OBS and MS Stream, so what you say now users will hear in 60 seconds. Also if you stop streaming in browser, it’ll disconnect in OBS, but if you connect it again in browser, OBS will be able to pick it up, so no additional work required in OBS if you disconnect and connect from MS Stream, this is all possible because stream uses the​​ RTMP protocol, which stands for Real-Time Messaging Protocol.​​ You can see this in the url provided by stream:​​ rtmps://..​​ 

This protocol is responsible for having a live connection between the streaming server (MS Stream) and the streaming encoder (OBS). That’s how it’s able to pick up the stream from OBS if you disconnect and connect again.​​ 

I hope this helps you setting up OBS with MS Stream, it’s a fun combination and very useful for organizations with many training/orientations videos for their employees.​​ 

 

Creating communication sites using Fiddler

Some SharePoint developers are still not familiar with how valuable Fiddler can be when developing applications. Some also would depend on other tools like Postman to get the job done, and others would find it hard to work with Fiddler and SharePoint at the same time​​ due to not being able to get authenticated to SharePoint from Fiddler. I’ll use this post to show the steps on how to use Fiddler with SharePoint online as well as show​​ the steps​​ to create communication sites using REST from Fiddler.​​ 

Obviously, first thing to do is to get Fiddler if you don’t have it already, you can get it​​ here.​​ The left pane in Fiddler is where network traffic is shown. Whenever you make a request or any program on your computer makes a request to any external server, Fiddler acts as a proxy and all traffic is passed through Fiddler as long as it’s running on your computer. You can notice that if you go to your internet options > Connections​​ tab >​​ Lan Settings, you’ll see something like this:​​ 

 

 

So now we know that Fiddler acts as a proxy and all network traffic is passed through it as long as it’s running. You can see all the traffic for your computer in the left pane in Fiddler.​​ On the right side, we have bunch of tabs, the only 2 we care about for now are the​​ Inspector​​ and​​ Composer​​ tabs.​​ Double-clicking on any​​ request will open the Inspector tab for you to see the Request (the top area), and the response (the bottom area). We’ll use the inspector tab first to get the cookies used to authenticate to our SharePoint online, later when we get the information about our cookies, we’ll use the Composer tab to make a request to post data to SharePoint to create a new communication site.​​ 

 

Let’s now get the cookies that are used to authenticate to SharePoint. Make sure you’re tracking capturing traffic​​ (remember all traffic info will appear in the left pane). To​​ verify that, click on the File tab and make sure that “Capture Traffic” is checked:​​ 

 

 

 

Next, open a SharePoint site in your Office 365 tenant, you’ll notice that Fiddler is going to capture that request:​​ 

 

 

Double-Click on that entry in Fiddler, and go to the Response section (the bottom right section in Fiddler) and click on the Headers tab:​​ 

 

 

You’ll notice​​ you have 2 cookies,​​ FedAuth, and​​ rtFa. Right click on the first one, and select​​ copy value only:​​ 

 

 

Open notepad, type​​ Cookies:​​ then paste what you copied, so you should have something like:​​ 

 

Cookies:​​ {CopiedValue}

Copy the second cookie value in Fiddler, then​​ in notepad​​ write​​ ;​​ afterwards​​ and paste the second value, so the full string you should​​ have​​ is:​​ 

 

Cookies: {FirstCopiedValue};{SecondCopiedValue}

Copy the whole text in notepad, and open the Composer tab in Fiddler, you’ll find it in the top right section. Change the HTTP request type to​​ POST​​ and paste the URL of your site in the next field and append​​ /_api/contextinfo,​​ then paste the string you had in notepad inside the Headers text area, so the composer tab should look like this:​​ 

 

 

Remember that the Cookie: … is the text you have as a result of what we did in notepad earlier when we captured the first request to our site. Again, it should be like this: Cookies: {firstCookieValue};{secondCookieValue}

 

Now click on​​ Execute, you’ll see that Fiddler captured the request in the list of requests on the left side.​​ Dobule-click on the request entry, you’ll see in the bottom right side (the response area)​​ in the​​ XML​​ tab there’s an entry for FormDigestValue:​​ 

 

Right click on this value and select​​ Copy, and head back to the Composer tab​​ where you were working, below the Cookies entry add this:​​ 

X-RequestDigest: {ValueofRequestDigest}​​ 

Change the URL to {YourSite}/_api/sitepages/communicationsite/create

So far you should have something like this:​​ 

 

 

So far so good! Now we have the Request Digest, we can make Post requests to SharePoint (Remember, you can make Get requests to SharePoint using only the Cookie entry without having to use X-RequestDigest. We only use X-RequestDigest to POST new data to SharePoint).​​ 

So, we got the Request Digest, what data do we need to POST to SharePoint? As we changed the URL to /_api/sitepages/communicationsite/create , that’s the end point to create new communication sites, so we’ll need to provide the info for this site in the request body (the bottom text area in Fiddler as shown in the previous image). Type this:​​ 

 

{
    
"request":{
      ​​ 
"__metadata":{
          
"type":"SP.Publishing.CommunicationSiteCreationRequest"
       },

      ​​ 
"Description": "Site created from Fiddler",​​ 
      ​​ 
"Title":"Communcation from Fiddler",
      ​​ 
"Url":"https://yourtenant/sites/CommFromFiddler"
    }

}​​ 

Try hitting Execute now, you’ll see an error in Fiddler on the left side:​​ 

It will tell you that you need to add a Content-Type in the header which we didn’t do, let’s add that, so go back to the Composer tab, and add the content type header as:​​ 

Content-Type: application/json;odata=verbose

 

 

Now hit​​ Execute​​ and you’ll see that you’ll get an entry in the requests area in the left pane with a result of 200, which means that the request was successful, if you navigate to the site specified in the Url in the request body, you’ll see that it’s created and it’s based on the Topic site design.​​ 

Note if you need to create an empty communication site or if you want to create one based on the showcase site design, you’ll need to add the SiteDesignId to the request body like this:​​ 

 

{
    
"request": {
        
"__metadata": {
            
"type": "SP.Publishing.CommunicationSiteCreationRequest"
        },

        
"Description": "Site created from Fiddler",
        
"Title": "Communcation from Fiddler",
        
"Url": "https://yourtenant/sites/CommFromFiddler",
        
"SiteDesignId": "f6cc5403-0d63-442e-96c0-285923709ffc"
    }

}

The above snippet will create an empty communication site. Showcase site design ID =​​ 6142d2a0-63a5-4ba0-aede-d9fefca2c767 .. and omitting the SiteDesignId will create a topic communication site.​​ 

 

An error you might face making a request to SharePoint is:​​ 

The type of data at position 5 is different than the one expected.

 

If you see this, make sure the request body you have is surrounded by curly braces { } not starting right away with​​ “request” : ..

 

I hope this was useful for you and you learned something new! Happy SharePointing!​​ 

Exception calling “SaveAsTemplate” with SharePoint 2019

I was trying to use PowerShell with a modern site (Communication site in my case) to save a list/library as a template and getting this error:

Having the UnauthorizedAccessException can be little confusing, so what’s the catch?

To solve this, we’ll use PowerShell, code looks like this:

Microsoft introduced prevented custom scripts from running by default in SharePoint online, and now with the introduction of modern sites in SharePoint 2019, they’re prevented by default in modern sites in SharePoint 2019. With custom scripts feature enabled, saving the site as a template and saving lists/libs as a template won’t be possible, hence you get the UnauthorizedAccess error. When custom scripts is active, the DenyPermissionsMask propert of the site collection will be: “AddAndCustomizePages” .. in order to allow custom scripts, it has to be “EmptyMask”.

You’ll need to run this command:

$site.DenyPermissionsMask = [Microsoft.SharePoint.SPBasePermissions]::EmptyMask

Now you can save the list/lib as a template.

ODFB & “Office Home & Business 2016” Issue!

I’ve been working with a client on an issue they had. A user had upgraded his Office suite to Office Home & Business 2016, after the upgrade, something with OneDrive For Business didn’t seem right. Documents stopped syncing, and stuff weren’t working as expected.

When checking OneDrive For Business, it was gone off the computer, so by following this KB article, you need to download OneDrive for business again and do the installation. You do this by following the points in the article, and having the .txt file in place for installation. Everything would seem to work fine, but you may encounter that it would stay for too long with no result. What you might want to do is change the .txt file, so replace the attribute Level=”None” to Level=”Full”. This way, if the command encounters any issue, it would really show that exact error or warnings.

For me what happened, is it shown incompatibility with what I was trying to install, and the system type. The default value in the .txt file for system type is “32” as shown in the “OfficeClientEdition” attribute, whereas the user was using 64-bit system. So change this value to “64” and you should be good to go.

 

Hide Upload Button + CSS Tip!

At times, you want to hide something that’s rendered by default in SharePoint, for example some of the ribbon’s controls rendered right away with the page. I’ve seen some people going with the way of hiding the whole “New” group in a document library in order to prevent user from using the upload or new folder options.

For the new folder, everyone knows it can be easily disabled from the library’s settings, but for the Upload button in the ribbon, you can use pure CSS to do so, but you will need to find the right selector, and use it right. We all know how to use developer tools to pick the right css classes, so as can be seen below:

UploadDoc

So you might be tempted to do something like this:

And.. that won’t work, you might be tempted as well to add !important to the end to force it to apply, but again.. it won’t work. It’s because CSS considers the dot character as part of the css itself to identify a class, and it won’t understand it’s part of the ID. In this case, you need to use escaping characters in CSS which is the backslash!

So your code should look like this:

Now you should end up with something similar to this:

Upload3

Hope this will quickly help someone out there!

External Sharing Report In SharePoint Online

Hello readers! This is a short blog post to share with you a PowerShell script that would be helpful for Office 365 admins in order to know who shared content in SharePoint Online. This script will create a .csv file with a list for each site collection that has content shared outside of the organization, as well as the name of the person with access to your environment, his email, the date when he accessed your environment the first time as well as who invited him to your environment.

Here’s a link to the script on codeplex. Hope this helps someone out there when he’s asked to do a such a report!

Root Site Collection Features Missing in SharePoint Online

When working with SharePoint online, you may think that the features and the way SharePoint is administered is similar to the way it’s administered on-premises, but there are some cases that may be tricky. One of these cases is once you create get your SharePoint online site up and running, you open the root site collection at the Url: http://DomainName.sharepoint.com and you do some work, then you’d like to save your team site as a template.. but the option is not there.

You may even face this problem when trying to:

  • Change themes.
  • Add content editor web part,
  • Deploy Sandbox solutions
  • Use SharePoint designer to style that site collection!

These are some major functionalities that you would want to use in your Office 365, but you can’t, and then you’ll start being frustrated about how SharePoint Online is limiting you from doing the work you’re supposed to do and you’ll start to embrace the on-premises way again!

But, it’s not a problem with Office 365, it’s actually a security feature in Office 365 for custom scripts, which means that it helps the global administrator for Office 365 to secure his sites from scripts being used here and there.

The scripting functionality is disabled in the root site collection by default, that’s why when you create another site collection under a managed path, scripting will be enabled and you’ll be able to use SharePoint Designer and other functionalities with no differences from the on-premises part, while the scripting is disabled, you’ll get this message when opening SharePoint Designer for the root site collection:

5-12-01

Then..

5-12-03

To enable scripting in Office 365, you should go to SharePoint administration center > Settings > Custom Script, as shown below: