While doing a workshop about PowerShell for Office 365 recently, and working with the Exchange Online PowerShell Module, which is needed to authenticate to Exchange Online with MFA , a lot of my students have hit the following error: Application cannot be started. Contact the application vendor.

Exchange Online PowerShell Module Error: Application Cannot be Started

Even if the Details tab don’t say much, this is an easy fix! This is happening only when downloading the Exchange Online PowerShell Module by using Chrome or Firefox, so the fix is simple: Use Internet Explorer to download the Exchange Online PowerShell Module! That’s it!

PS: If you want to know how to connect to all Office 365 using Multi Factor Authentication, check out this blog: Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Leave a comment and don’t forget to like the Absolute SharePoint Blog Page   on Facebook and to follow me on Twitter here  for the latest news and technical articles on SharePoint.  I am also a Pluralsight author, and you can view all the courses I created on my author page.
5/5 (4)

Please rate this

I’ve been a big fan of PowerShell for Office 365 for a while now, and with new features coming out in Office 365 that are only configurable by PowerShell, it’s more important than ever to be able to at least master the basics, but you absolutely need to know PowerShell for Office 365 in order to have full control of your tenant.

Resources to learn PowerShell for Office 365

Jeffrey Snover, creator of PowerShell and Technical Fellow at Microsoft explains it in a more direct way

When someone answered that their clients do not listen, he was pretty direct with his reply.. you need to learn PowerShell to stay relevant , and even more important to learn it as an Office 365 admin.

So, here are some resources, depending on what type of learner you are!

Books

Books are really ways to learn a topic from start to master, and even if they cost some dollars, they’re always a good investment!

Learn PowerShell for Office 365

Essential PowerShell for Office 365: Managing and Automating Skills for Improved Productivity
Take your Office 365 skills to the next level. Master PowerShell for Office 365 to stay competitive in today’s world of highly sought after cloud management skills. With expert guidance, IT pros will learn how to leverage the muscle of PowerShell to automate many advanced administrative tasks not otherwise accessible in the Office 365 Admin Center. You will discover how to unlock configuration options and automate tasks in order to free up valuable time and resources.

Get it on Amazon at the following links:

Video Training

NOTE: Pluralsight is a paid resource unlike Channel9, Youtube, and Microsoft Virtual Academy which are free. The quality they provide is also superior because of all the quality checks they go through, and the instructors are one of the best in the industry. The Pluralsight courses have a link to where you can get a free trial and decide for yourself if paying a subscription or not is worth it, but the 10 day free trial should allow you to view all those courses for free.

Learn PowerShell for Office 365

PowerShell for Office 365
In this course, you will learn how to use PowerShell to manage Office 365 services. You will learn how to connect and manage users and licensing, SharePoint Online, Exchange Online, Compliance Center and last but not least, Skype for Business Online.

Learn PowerShell for Office 365

PowerShell Playbook for Office 365
A more advanced look at multiple real-life scenarios that span across all Office 365 Services and show you how your PowerShell for Office 365 skills can be applied in your day to day life

PowerShell for common Office 365 Operations
In this 300 level session, you will learn how to automate the management of Office 365 using Windows PowerShell. We will discuss how to connect Windows PowerShell to Office 365, tour the Office 365 cmdlets, and demonstrate how to manage domains, users, and services including Exchange Online, and SharePoint Online.

Support Corner: Using PowerShell to Manage Office 365 Users
Join us in this fast-paced demo to learn how to manage Office 365 users using PowerShell. Experts show you how to create and delete users, update user IDs and passwords, assign licenses and groups, and much more.

Blogs / Links

This a list of blogs, or Microsoft Docs ressources on PowerShell for Office 365! All those are free! This list is currently in construction, and will be better organized in the future!

 

Leave a comment and don’t forget to like the Absolute SharePoint Blog Page   on Facebook and to follow me on Twitter here  for the latest news and technical articles on SharePoint.  I am also a Pluralsight author, and you can view all the courses I created on my author page.
5/5 (2)

Please rate this

Is your Pluralsight subscription up for renewal soon or have you been waiting for a promotion to become a Pluralsight subscriber? Pluralsight, one of the best on-demand online training companies with over 6000 courses is currently having a promotion between March 26th and 31st 2018 to save 100$ on your Yearly Pluralsight Subscription, and it even works on renewals!

Save 100$ (33%) on a Pluralsight Subscription

Whether you’re interested in learning SharePoint, Office 365, PowerShell, Angular or even Ethical Hacking and Security, 199$ for a year of unlimited learning is an amazing deal! Get the promotion now, click on the banner above or at the following link: https://spvlad.com/PSMarchMadness ! Don’t wait too long as the deal ends on March 31st and it might not come back until the end of 2018!

If you are an Office 365 / SharePoint person, here are some of my courses on Pluralsight:

Planning for SharePoint Server 2016: Physical Topology and Services

SharePoint Server 2016 brings a lot of changes to the Infrastructure Architecture, with new features such as MinRole and Microsoft Identity Manager. You’ll learn how to plan your SharePoint 2016 Infrastructure to answer your business needs.

Save 100$ (33%) on a Pluralsight Subscription

Planning for SharePoint Server 2016: Logical Architecture and Integrations

This course will teach you how to plan your SharePoint 2016 logical architecture, SharePoint farm security, and how to plan for integration with Exchange Server 2016 and Project Server 2016.

Save 100$ (33%) on a Pluralsight Subscription

Implementing a Hybrid SharePoint 2013/2016 Infrastructure

SharePoint hybrid infrastructures are gaining popularity, so SharePoint IT professionals need to prepare. You’ll learn how to configure a hybrid infrastructure in either SharePoint 2013 or SharePoint 2016 to allow your users to be more productive.

Save 100$ (33%) on a Pluralsight Subscription

PowerShell for Office 365

Take your Office 365 Administrator skills further by learning to automate repetitive tasks as well as access advanced settings using the magic of PowerShell.

Save 100$ (33%) on a Pluralsight Subscription

Leave a comment and don’t forget to like the Absolute SharePoint Blog Page   on Facebook and to follow me on Twitter here  for the latest news and technical articles on SharePoint.  I am also a Pluralsight author, and you can view all the courses I created on my author page.
5/5 (5)

Please rate this

Whether you want to do some reports or debugging, you might need to quickly find out what Office 365 Groups a user is a member or Owner of! You could go in the user’s profile, see all the groups, find out which ones are Security, which ones are Distribution Groups, and which ones are Office 365 Groups. or you could do an easy PowerShell cmdlet!

Find all the Office 365 Groups a user is a Member of with PowerShell

Since we will be playing with Exchange Online, you first need to connect to Exchange!

 

Next up, I will save the E-mail of the person I am looking for in a variable called UserEmail, and use the GetMailbox cmdlet to save the Mailbox object of that user in a variable called Mailbox.

 

After we have this information, we can use the Get-UnifiedGroup PowerShell cmdlet, together with the Get-UnifiedGroupLinks cmdlet to find which groups this user is a member of!

To find all the Office 365 Groups a user is a member of, we would use the following cmdlet:

We then have all those groups stored in a variable, and we can use them as we wish inside PowerShell!

Find all the Office 365 Groups a user is a Member of with PowerShell

To find all the Office 365 Groups a user is an owner of, we would use the following cmdlet:

As you see, the only thing that changed is the -LinkType parameter from Members to Owners! We now also have all those groups stored in a variable to use as we wish in PowerShell!

Find all the Office 365 Groups a user is a Member of with PowerShell

 

Follow me on Social Media and Share this article with your friends!

Leave a comment and don’t forget to like the Absolute SharePoint Blog Page   on Facebook and to follow me on Twitter here  for the latest news and technical articles on SharePoint.  I am also a Pluralsight author, and you can view all the courses I created on my author page.
5/5 (4)

Please rate this

Whether you want to do some reports or debugging, you might need to quickly find out what Distribution Groups a user is a member of! You could go in the user’s profile, see all of the groups , find out which ones are Security, which ones are Distribution Groups.. or you could do an easy PowerShell cmdlet!

Find all the Distribution Groups a user is a member of with PowerShell

Since we will be playing with Exchange Online, you first need to connect to Exchange!

 

Next up, I will save the Username of the person I am looking for in a variable called Username

And then, I will use this cmdlet which will get all the Distribution Groups in my tenant, and then find the ones where my username is in the members! (This assumes your e-mail address is the same as the username! If that’s not the case, you can simply put the e-mail in the UserName variable and it will work!)

You can now either Display it , or do another action such as removing the user from all of them!

Find all the Distribution Groups a user is a member of with PowerShell in Office 365

That’s it! As you see this is really an quick and easy PowerShell snippet!

 

Leave a comment and don’t forget to like the Absolute SharePoint Blog Page   on Facebook and to follow me on Twitter here  for the latest news and technical articles on SharePoint.  I am also a Pluralsight author, and you can view all the courses I created on my author page.
5/5 (5)

Please rate this

You cannot have full control of your Office 365 tenant, if you do not know how to use PowerShell for Office 365, since there are a ton of configurations, and settings that are only configurable via PowerShell, and not via the Office 365 Admin Center! Not to mention, all the automation capabilities that PowerShell allows you to script, so you save time and money. Since most accounts admin accounts are (or should be) configured with Multi Factor Authentication, here is a small guide on how to connect to all the Office 365 services with PowerShell and Multi Factor Authentication enabled!

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Azure Active Directory

Once you have the Azure Active Directory module installed, connecting with Multi Factor Authentication is done by specifying the AccountId parameter, and not a full credential object as we would do with single factor authentication. This will Open up a window, asking you to enter the password for that account, and then your second authentication method as seen below.

 

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

SharePoint Online

When we connect to SharePoint Online using PowerShell, we use the Connect-SPOService cmdlet as usual as well as the URL parameter, which is the URL of your SharePoint Online Admin Center, and simply skip specifying the -Credentials parameter. This will open a pop-up window asking for our credentials, as well as the second method of Authentication as you can see below!

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Exchange Online

While the previous two were easy, this one is a bit more complicated since we need to download a module, whereas to connect with Single Factor Authentication there is nothing to download! From the Exchange Online Admin Center, go to the Hybrid section, and click on Configure under the Exchange Online PowerShell module.

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

You need to do this with Internet Explorer, or else you will be getting a beautiful “Application Cannot Be Started” error as we talked about in this blog! Exchange Online PowerShell Module Error: Application Cannot be Started – Contact the Application Vendor

Once you have the Exchange Online Module, you need to use the Connect-EXOPSSession PowerShell cmdlet, and specify the user account that you will be connecting with.

 

If you are in Office 365 Germany, you need to provide a few more parameters, as seen in the following example.

 

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Office 365 Security and Compliance Center

To connect to the Office 365 Security and Compliance Center with Multi Factor Authentication, you need the same PowerShell module as Exchange Online, about which we talked earlier, but you will be using the Connect-IPPSSession PowerShell cmdlet as seen in the following example.

If you are part of Office 365 Germany, you will need to provide the additional parameters seen below.

 

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Skype for Business

To connect to Skype for Business Online using Multi Factor Authentication , you need to use the New-CSOnlineSession PowerShell cmdlet

 

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Microsoft Teams

To Connect to Microsoft Teams, you use the Connect-MicrosoftTeams PowerShell cmdlet, and specify the -AccountID parameter. Similar to the other services, you will get a prompt asking you to input your password, and second method of authentication.

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

Connecting to all Office 365 Services with PowerShell and Multi Factor Authentication

That is it, we have now looked at how to connect to all Office 365 Services, using PowerShell and Multi Factor Authentication!

Leave a comment and don’t forget to like the Absolute SharePoint Blog Page   on Facebook and to follow me on Twitter here  for the latest news and technical articles on SharePoint.  I am also a Pluralsight author, and you can view all the courses I created on my author page.
5/5 (2)

Please rate this

This year I have the great pleasure again of travelling to DC to speak at SharePoint Fest DC 2018! This year’s SharePoint Fest is the biggest one ever with 2 days of workshops, and 3 days of sessions! Just look at the numbers below!

If you didn’t sign up yet, you can use my code to save 100$ of your registration on the site at https://sharepointfest.com/DC/

Here is what I will be speaking on!

Morning Workshop 9:00 am – 12:30 pm, Monday WS 201 – Congratulations, you are our new SharePoint Online Admin!

You have managed SharePoint On-Premises for a while and got comfortable with it, but now your company is moving to Office 365! Chances are, you will become the new SharePoint Online Admin!

In this half day workshop, we will look at how to administer SharePoint Online, as well as some other Office 365 services that are often administer by the SharePoint Online Admin such as Groups, Planner, Video and more!

Afternoon Workshop 1:30 pm – 5:00 pm, Tuesday WS 601 – Mastering PowerShell for Office 365

Until you master PowerShell, you cannot have full control of your Office 365 tenant! PowerShell enables you automate boring tasks, and also gives you access to the more advanced settings that are not available in the Office 365 admin center. In this workshop, we will learn how to manage our users and licenses in Azure Active Directory, manage our SharePoint Online Sites, Exchange Online, Office 365 Groups as well as Skype for Business!

After finishing this workshop, you will be able to manage all the aspects of your Office 365 tenant, and automate multiple boring tasks.

BV 301 -What do YOU get from SharePoint Hybrid?

Every time you see a blog post about SharePoint 2016, you see the word hybrid. But what exactly is a hybrid infrastructure and what features does the business user get? In this session, we will look at SharePoint Hybrid from a business user point of view to understand what features we get out of it. We will look at Hybrid Sites, Hybrid Search, Hybrid Taxonomy and more!

ADM 203 – Advanced PowerShell for Office 365

Know the basics of PowerShell for Office 365 but want to take it further? In this session, we will look at some awesome real-life examples of how PowerShell can make our life as an admin easier, and at quite a few things that cannot be done from the User Interface! This session requires you to have basic knowledge of PowerShell for Office 365.

WF 103 – Three Must-Have Workflows with Microsoft Flow

Are you on Office 365 or planning to move soon? Learn how to automate business processes with Microsoft’s latest workflow tool: Microsoft Flow! In this session, we will earn the basic of workflows, how Flow works and create a few awesome examples!

Hope to see you there!

5/5 (2)

Please rate this

While working on some reporting with PowerShell and Office 365, I have discovered something that might be important if you use the Get-SPOExternalUser PowerShell cmdlet to create reports on your SharePoint Online external users.

Get-SPOExternalUser PowerShell

At the end of 2017, Microsoft has released a new , simpler, and nicer way to share SharePoint Online content with your external partners, allowing them to log in with a simple pin / e-mail validation , without them needing to have a Microsoft account anymore. Users loved it, but it seems the PowerShell module hasn’t yet been updated to show those new users yet. Microsoft is already aware of this problem and they have an issue open on the GitHub site for the SharePoint Online PowerShell Module.

This is valid as of the February 2018 version of the SharePoint Online PowerShell Module and I will update this blog with the version when Microsoft fixes it or gives an official workaround . You can also check live updates directly on the issue on GitHub!

The Bug

To show you the bug, I will first invite an external user to a document in a modern SharePoint Online site called Modern Share Test, you can see the screenshot of the invite below.

Get-SPOExternalUser PowerShell

I will then navigate to outlook for this example, accept the invite and then log in to view the document shared with me. As you see in the screenshots below, I am first asked to validate by e-mail, Microsoft Sends me a PIN number, I enter it in the box, and it all works nicely. Off topic, but good job to the Microsoft people who worked on this feature as the end-user experience is amazing.

Get-SPOExternalUser PowerShell

Get-SPOExternalUser PowerShell

Now I will go to PowerShell and run a Get-SPOExternalUser on that Site Collection, and as you see below, it only returns a user, and it’s not the one we just invited!

Get-SPOExternalUser PowerShell

However, if I run an Get-SPOUser cmdlet against the same site, we can see that users added with this modern sharing option have a different login name vs our old external users. The Old naming convention was using #ext# while the new one is urn:spo:guest . In the screenshot below, you can see the accounts in a red box that use modern sharing, and the new naming convention, and the account in the green box that uses the older, Microsoft account method (or Azure B2B).

Get-SPOExternalUser PowerShell

Luckily, even if the Get-SPOExternalUser PowerShell cmdlet is not perfect anymore and only works with accounts that log in with a Microsoft account, we can still create reports using the existing cmdlets.

The Workaround

Here is a small script that I have done that uses the Get-SPOUser cmdlet to return the external users per site collection and exports them to a CSV file at the end and includes the URl so you can also do some nice filtering. There are a ton of ways to do PowerShell, and probably a ton of ways to do this, but here is a way that I have tested, and it works!

 

And here is a screenshot of the CSV, with a Filter on the URL we have talked about before!

Leave a comment and don’t forget to like the Absolute SharePoint Blog Page   on Facebook and to follow me on Twitter here  for the latest news and technical articles on SharePoint.  I am also a Pluralsight author, and you can view all the courses I created on my author page.

Follow me on Social Media and Share this article with your friends!

5/5 (5)

Please rate this

One of the really cool things that we can do with SharePoint Online is to easily share documents, or sites with external users. The cooler thing even is that now my users can securely share stuff, without having to go through IT, so as an Office 365 Admin, I have a lot more time to be productive, rather then create FBA or AD accounts for my external users as I did On-Premises. However, even if I don’t have to do it myself, I still want to stay informed about what external users have access to what, and who got added to what Site Collection, so I have created a few scripts for it!

My first report is one that I run on a weekly basis, and it’s a easy one: What users have been added to my SharePoint Online environment in the last 7 days? The script is simple, I will use the Get-SPOExternalUser cmdlet to get all of my external users, and I am using the loop that I have blogged about here (Getting More than 50 users with the Get-SPOExternalUser PowerShell cmdlet in SharePoint Online) in order to get more than the limit of 50 per query. I am adding a Where statement, where I specify that I only want users that have the WhenCreated property bigger than Today – 7 days, which means they have been created in the last 7 days! Lastly, I am selecting the properties that I want to show and format the result as a table.

 

Here is what this looks like in action:

Create a report of SharePoint Online External Users with PowerShell

My second report is something that you can either run on a scheduled basis, or only whenever security asks for a more formal report on what is happening in the tenant. What it does is that it will loop trough every Site Collection, and then output every external user that has access to that Site Collection. We will save information about the user in a custom object, as well as the URL of the site they had access to. Lastly, we will export everything to CSV, which as you know allows us to do some nice filtering directly in Excel, or if you want to take it to the next level you can even use it as a data source for a Power BI report let’s say, but we will not get into that topic today. Here is the script:

 

And here is the result in the CSV File opened in Excel! I could use filtering on the URL, or on the User license if I wanted to get more info!

Create a report of SharePoint Online External Users with PowerShell

The last report that I want to show you is a really interesting one that can be really important for your organization: It shows you all the external accounts that have been invited to your tenant using an e-mail address, but they have accepted the invitation and are using a different e-mail address to authenticate to your SharePoint Online. To put it in a more real-life example, let’s say you created a site to work with Contoso, and you invited vlad@contoso.com to your SharePoint Online Site Collection. When receiving the invitation, Vlad has decided to use his personal e-mail address: vlad@hotmail.com to authenticate to your Site Collection. If Vlad decides to leave Contoso, even if his corporate account is disabled, he can still have access to the Site Collection you shared with him since the account that has access is the personal one. If your NDA agreement for example was between Contoso / Your Company and he’s not at Contoso anymore, this can cause you troubles down the road! To get those accounts, you need to use the following parameter, which probably can win an award for one of the longest parameters in PowerShell: ShowOnlyUsersWithAcceptingAccountNotMatchInvitedAccount. Here is the full code:

And here is a screenshot of the result:

Create a report of SharePoint Online External Users with PowerShell

Leave a comment and don’t forget to like the Absolute SharePoint Blog Page   on Facebook and to follow me on Twitter here  for the latest news and technical articles on SharePoint.  I am also a Pluralsight author, and you can view all the courses I created on my author page.

Follow me on Social Media and Share this article with your friends!

5/5 (5)

Please rate this

One of the reports that a lot of Office 365 admins use, is to see what external users have access to the tenant in SharePoint Online. Luckily, Microsoft offers a PowerShell cmdlet in the SharePoint Online module named Get-SPOExternalUser.

More Than 50 External Users With the Get-SPOExternalUser

While that cmdlet might seem easy and straightforward to use, there is a small catch; it can only return 50 External Users at a time due to a limit on the PageSize Parameter.

More Than 50 External Users With the Get-SPOExternalUser

A lot of scripts that you find on the Internet will give you a command like Get-SPOExternalUser -Position 0 -PageSize 50 … and that will work great , if you have less than 50 users in your tenant! However, if you have more than 50, you will need to do something just a little bit more advanced in order to be able to see all of them. What we will do, is that we will use a For Loop wrapped in a try/catch and try to get 50 users at a time, playing with the -Position parameter until the cmdlet stops returning information. You can view the script below:

 

And here a screenshot example where I am checking the number of users returned, and as you can see it’s over 50, so the script worked!

Leave a comment and don’t forget to like the Absolute SharePoint Blog Page   on Facebook and to follow me on Twitter here  for the latest news and technical articles on SharePoint.  I am also a Pluralsight author, and you can view all the courses I created on my author page.

Follow me on Social Media and Share this article with your friends!

5/5 (3)

Please rate this