New open source project: The SharePoint Admin Bot

I’ve started a new open source project called the SharePoint Admin Bot or SPAdminBot for short. Why you ask? Because I got tired of doing and seeing people do the same tasks over and over again on SharePoint Online and Office 365. For something simple like creating a site collection you would always have to go into the admin portal and click through multiple pages to get the job done. These kinds of simple tasks can be easily done by a bot.

Bot Framework.

With the introduction of the bot framework and recent improvement in the Microsoft Cognitive Services, especially LUIS. Microsoft provides a great platform to easily create a bot.

Can I just start using the SPAdminBot?

Yes, you can. The source code is available on GitHub but I’ve also installed in my own Azure environment and made several channels available. The bot is configured as a multi-tenant app. So you can just login, give permission and start testing it out. You can talk to the bot through the following channels:

The reason why I am running this on my own environment with my own keys is that I want to learn more on how LUIS understands natural language. This will give me some insights on how to configure it properly. If you have concerns that I am stealing your tenant information or any kind of personal data you should not worry. The code is available on GitHub so you can see that I am not doing anything with your data.

My personal favorite is that is works in Microsoft Teams. I already have this open during the day so quickly asking the SPAdminBot to do something for me is something I like the most.

How to use it

When starting a conversation with the SPAdminBot (If anybody can suggest a better name  feel free to contact me) the first thing you need to do is authenticate. After authentication the fun part starts. Ask it to create a site collection, reindex a site or get information about a site collection or web.

AuthBot

If you examine the code then you can see that I included the AuthBot. This is a great project provided my Microsoft and the idea of Mat Velloso. This guy is an absolute genius. They also provided a Nuget Package which I could have easily used but I needed to tweek some parts of the code for my bot for working with multi-tenant apps and to get it working with SharePoint CSOM ClientContext. This way I could make it publicly available as a multi-tenant app. I’m not sure if this was the right decision because now I have to keep updates manually in sync. But I can always revert back.

Current Features

Currently the bot can only get Site collection, Root web information, reindex a web and create a site collection. This is the reason why I am putting this project out in the open. I’m hoping that people will help me get more coverage on features that they waste time with every day and that they would like to see automated. If you have a feature request, feel free to submit an issue and mark it with the enhancement tag.

Enhancements

Currently if you start the consent flow (authenticating in the bot) then you get the consent screen. Currently there are to many consent requests. I know it’s a long list but as any developer would confirm. I just clicked on everything because I didn’t want this to be an issue during development. Ideally when the Azure AD V2 endpoint gets full support then I am going to switch to this one.

I did not yet publish the bot to the bot directory. If the coverage of the features becomes bigger then this might be something to think about.

I would love you use the MS Graph more but for that I would need to wait until they added more features. And of course extend certain features so that you could also manage Office 365 settings.

So, all I can say is… try it out. If you have any comments or remarks feel free to contact me. Change the code and do a pull request or just ask for a new feature.


Also published on Medium.

Leave a Reply

Your email address will not be published. Required fields are marked *