How to bulk add users to a MS Team

Sometimes you want to bulk add users to a team. There is an interface to add users but you have to add them one by one:

In some cases you want to add a lot of users. For example you are a teacher and wants to add your students before the start of your classes. Doing this one by one will be very time consuming. So I created a PowerShell script to do this. You don’t need any special permissions to run the script. You only have to be the owner of the team.

First we need a few things:

The teams group Id

Every team (or group) has an unique Id. You can find this by getting the link of the team and search for the groupId parameter in the url:

The url is something like this:

https://teams.microsoft.com/l/team/19%3a544927be176e42efbb0afbf956828ed7%40thread.skype/conversations?groupId=e000eb72-0948-4a89-b1ad-ad708beebbb4&tenantId=1a5763a5-a000-486d-8bed-162db29f5e62 (fake url for security reasons 😉 )

You need to copy the id: e000eb72-0948-4a89-b1ad-ad708beebbb4

Next we need a list with email addresses that you want to add. Store them in a plain text file (input.txt)

The script will use Microsoft Teams and AzureAD commands so make sure you have installed them by running these commands in PowerShell once (open the PowerShell terminal with elevated permissions):

Install-Module -Name MicrosoftTeams 
Install-Module -Name AzureAD

Now we can start, run the following script. You’ll have to enter your credentials a few times.

#change the path to the text file:
$emailaddresses=Get-Content -Path "C:\Users\demouser\input.txt"

#change the ID parameter here
$teamId="GROUP - ID"

# -----------------------------------------
# Run this first
# -----------------------------------------
Set-ExecutionPolicy RemoteSigned
# -----------------------------------------

#not working with MFA accounts
#$crendentials=Get-Credential

Connect-MicrosoftTeams #-Credential $crendentials
Connect-AzureAD #-Credential $crendentials

$team=Get-Team -GroupId $teamId

$groupMembers=(Get-AzureADGroupMember -ObjectId $teamId -All $true | select UserPrincipalName)

#Write-Host $groupMembers

Write-Host "Check current users" -ForegroundColor White
for($i=0; $i -lt $groupMembers.length; $i++){
    write-host $groupMembers[$i]

    #check if user is in valid user list
    #if NO, then delete the user from TEAMS

    if($emailaddresses.tolower().Contains($groupMembers[$i].UserPrincipalName.toLower())){
        #Write-Host "user found"
    }
    else{
        Write-Host "user not found: remove from TEAMS" -ForegroundColor Red
        Remove-TeamUser -groupId $teamId -User $groupMembers[$i].UserPrincipalName
    }
}

#add new users
Write-Host "Check user membership" -ForegroundColor White
for($i=0; $i -lt $emailaddresses.length; $i++){
    write-host $emailaddresses[$i]
    $bUserFound=$false
    #check if the user is already in TEAMS
    #if NO, then ADD the user
    for($j=0; $j -lt $groupMembers.length;$j++){
      
        if($groupMembers[$j].UserPrincipalName.toLower() -eq $emailaddresses[$i].ToLower()){
            $bUserFound=$true
            #Write-Host "user found in teams members list" -ForegroundColor Yellow
            break
        }
    }

    if(!$bUserFound){
        Write-Host "adding member to TEAMS" -ForegroundColor Green
        Add-TeamUser -GroupId $teamId -User $emailaddresses[$i]
    }

}

Feel free to use this!

Populate a Word document with Microsoft Flow

A few weeks ago a client asked to create a workflow that pre-populates a Word document with some data from a SharePoint list. This was my chance to use the new Microsoft Flow action called: Populate a Microsoft Word template.

This action can read a Word document and populate the fields you defined. You can add fields to a Word document via the “Developers tab” in Word. You have to enable this first when you haven’t done this before. If you are not sure how to do this you can check this help page.

For now the Flow action only works when these conditions are met:

  1. Only text controls are allowed (no checkboxes and so)
  2. The file must be on your OneDrive for Business, not on a SharePoint library (I hope this changes real soon!)

So I created a word file with a plain text control and stored it on my OneDrive for Business folder.

Next I created a SharePoint list where the customer added an item for each meeting that was organized. The item contains a text field with the names of the attendees.

The create the Word document I created a Flow that runs for a selected item in that list. In this development example I created an input field to test the flow:

next you need to populate the Word file (I fetch the data from the listitem first to use later in the flow)

To finish I create a new Word file on a SharePoint library:

So in this flow I

  • Populated a Word document with some data from a SharePoint list item
  • Created a file with that content to a SharePoint list

There are still some issues with this Flow action but it looks promising. I hope that soon we can populate other fields (repeating fields??) and the template file can be stored on SharePoint instead of OneDrive for Business.

Flow for event registration and automated meeting request

Today I had this question from a client:

Can I use Office 365 for event registrations linked to my calendar?

Event registration? Sure. Create an input form with Microsoft Forms! That’s easy. But the client wanted to send the registered users a meeting request. Not just a single meeting request but all users must be added to the existing meeting in his calendar.

First, let’s create the form:
I created a form with some basic fields like name, first name and email.

So for so good. Make sure the form is accessible for anonymous users.

Next, I need to create a workflow that sends the (updated) meeting request to the users:

First I need the Forms trigger “When a new response is submitted”:

Then we need the form entry details. You can use the “Get response details” action. A loop will be created for you:

Select the form id and use the Response Id from the previous step.

Now the “tricky” part. We need to update an existing meeting request in the calender of the user.
First we need the meeting details. Use the “Get event (V2)” action to do this:

First select the calendar in the dropdown. Next we need the ID of the event. This was the part I needed to think 😉

How can I find the Id of an event? There is no interface in outlook for this but there is the Office Graph Explorer!
The Office Graph Explorer is an interface on top of the Office 365 API. Build for developers. There is an API to get a list of events and there you can find the ID of a certain event! Cool isn’t it?

First sign in with your Office 365 account to use the Graph with your data. Next check your profile to see if it is working:
You should see your data:

Now use this query: https://graph.microsoft.com/v1.0/me/events this will get you a list of all events in your calendar:

In the response preview window you will get a list of events. In that list you can find the Id of each event:

Now we will use that Id in our flow.

Next add the “Update event (V2)” action. With this action you update the properties of a calendar event.

Use the same ID, add the fields that don’t need to be updates. Use the content from the previous step here.
The attendees are behind the “advanced options”. Add the field from the previous step and the email address of the user that he entered in the initial form:

This is the trick that did it!

So, I could answer the question of the client. It is possible to build an event registration (no code) solution based on Office 365!

How to make a personal view public in SharePoint

On any SharePoint list you can create 2 types of views:

  • A public view: anyone with read permissions can select this view.
  • A personal view: only the person who created the view can select this view.

Once you set the “Audience” of the view you can no longer change this.

In some cases you want to “Share” a personal view with others. There is no easy way to do this but you can use this hack:

Create a new view based on your personal view

Select “Start from an existing view” and click the name of your view.

Now you see that the option to create a public view is disabled. You only see this option when you have permissions to create a public view (Full Control).

Now you use the developer tools of your browser to change the “disabled” attribute on the radio button. It depends on your browser where you can find this tool. In Chrome you find it via Settings > More > ….for developers (my screenshot is in Dutch).

 

Use the selector to select the disable radio button and remove the disabled attribute.

 

Now you can select the “public view” option and go create the view.

 

Why attending a tech conference is important

Some people might not be aware of this open secret which has everything to do about technology. We currently live in a ubiquitous era, the era where technology has become part of our daily life. Our smart phones, robots and lots more are examples of tech devices that are gradually taken over powerful world economies. However, as researchers predicts a continuous trend, then there is an important need for workers and individuals to learn better ways of integrating technology into their everyday lives.

One of the ways to do this is by attending conferences, according to research, networking is one of the reasons why attending conference is important. It gives you the opportunity to make new friends especially in your own field and career.

Why should I attend the technology conference?

AN OPPORTUNITY TO LEARN NEW TRICKS

As technology continues to evolve, there will be a need to get acquainted with the new devices, applications and more.Nevertheless by attending technical conferences you will be able to learn new methods and tricks in the technological world. For instance during the training sessions, presenters and speakers share information and new insights about working environment. New methods of completing tasks is shared and you have the opportunities to ask questions about concepts that might seem difficult to understand. Guidelines and new packages are often introduced and delegates are allowed to practice what they have learnt from the conference.

PROFESSIONAL NETWORKING

Attending conferences is the easiest way to meet new people and build smart network. You will be amazed at how people are willing to collaborate, discourse about their achievements and challenges. Begin the conversation with by asking where the person works or simply do the introduction and allow others to initiate the conversation. You will be amazed with what you will learn.

NEW PERSPECTIVE AND INSIGHTS

Attending tech conferences helps you gain new insights about the global trends and innovation in the technology industry. With careful observation and the appropriate attention during presentation, you can evaluate your project executions (strength and weakness) and give you a mental picture of where you should focus and build.

Of course, it’s an opportunity to learn from tech leaders that have achieved what you aim to achieve. Learning from their success and failure stories will help you sharpen your skills and achieve more in your region.

LATEST TECHNOLOGY

Tech conferences gives you the opportunity to see new products, games, gadgets and new technologies  before it is unveiled in the market. This helps you access where your business and company should focus in the future.

Use the tech conference as an opportunity to learn their experiences when the products were still in the process. Do not forget that speakers also want to know your experiences and network with you as well, so play the card well. After all it’s a conference and winners take it all. Take part of the panel discussions and remember to talk with an attendee, they might have observations from a different point of view.

There are lots of swag and opportunities that comes as a result of attending tech conferences, aside the fact that companies want to showcase their brand (which leaves travelling back with lots of free gifts), you also have the opportunity to get some selected products and offers at an amazing and affordable rate. You probably know the rules of the game, the one that gets the relevant information usually takes the lead in the tech industries.

An overview of the collaboration options in Office 365

With the shift to the cloud we have seen the last years, office 365 has consistently displayed its strength in this area by providing end users and teams with mind blowing collaborations tools to ease their daily activities. In fact, office 365 is believed to have one of the best team collaboration tools in the market today. So what are these collaborations options and how do end users get to make the most of these tools? Well, read on, and all your queries will be adequately addressed. Below is the current list of collaboration option available on office 365

1. Team sites available in SharePoint online

2. Communication sites also available in SharePoint Online

3. Office groups

4. Skype for business

5. Yammer Groups

6. Microsoft Teams

Team sites in SharePoint online

This is one outstanding collaboration option available to end users of office 365. With these team sites, team members can easily access the home page, document libraries as well as other activities and news feed. With SharePoint online team sites, team members can effortlessly work or collaborate on documents regardless of their location. As one of the most powerful collaboration tool in office 365, this collaboration option is perfect for large team members who are looking for a user-friendly tool that allows them to communicate, follow team activities while storing other relevant data and links.


Communication sites

Unlike team sites that keep team activities private, communication sites on SharePoint provides organization wide communication. This means whatever is published on a communication site is readily available to every team member of the community on SharePoint. Also, communication sites are easy to customize, this means, end users can now set up their own SharePoint sites without having to speak to SharePoint developers. This collaboration option is perfect for HR departments, who rely heavily on communication. Interestingly, this collaboration option can be used to discuss and announce other events within the community.


Office groups

This is the perfect collaboration tool for team members and organizations that prefer email based collaboration. This office 365 collaboration tool features options like shared outlook inbox for email based communication, a shared calendar to manage group events, an archive to store group data, a tool to plan and manage group activities. The icing on the cake for users of this collaboration tool remains the fact that this office 365 collaboration option allows users to communicate with external users who do not want to grant them access to their team site.


Skype for Business

While this collaboration tool might not be the top on the list of office 365 collaboration options, it remains an integral member of the office 365 collaboration pack. Skype for business allows VoIP calls, instant messaging, video calls and web conferencing.


Yammer Groups

Although Yammer group is very similar to office 365 outlook groups, it has its own profound features which make it a valuable member of the office 365 collaboration options. This tool allows users to manage and plan events using build-in calendar features, while also granting them access to OneNote Notebook etc. Again, while this tool supports file sharing, it allows for external users to be added to the collaboration process.


Microsoft teams

Microsoft team is considered the game changer in the world of team collaboration. And for those who know the amazing features of this tool, they wouldn’t agree any less. As a direct rival to Slack which is a very popular collaboration tool in the industry today, Microsoft teams have continued to live up to user’s expectations. This tool which is integrated into the office 365 pack allows team members to collaborate on different channels or set up isolated channels for other private discussions. This tool is securely incorporated with Skype, and allows for voice calls and other video conferencing facilities. Because Microsoft office team is integrated with office 365, users can take advantage of other collaborative tool featured on office 365.


So, it’s completely up to you to choose the collaboration options that addresses most of your needs.