Under the Hood #6: Automating SharePoint with PowerShell, Azure Automation & Flow

In this session we looked at some real-world examples of how you can create PowerShell scripts SharePoint Online in Azure Automation. We started with what Azure Automation is and how to configure it for SharePoint Online. You’ll also learn some tips and tricks to using Azure Automation with SharePoint Online and Office 365. Once we have Azure Automation setup, we then walk through how you can trigger a PowerShell script using Microsoft Flow. To wrap up, we walk through some real-world scenarios where you can tie all the services together to be used for provisioning SharePoint sites and OneDrive as well as reporting on your SharePoint Online environment.

What you will learn:

  1. How to create an Azure Automation Account
  2. How you can use PowerShell in Azure Automation with SharePoint Online
  3. Incorporating Azure Automation runbooks into Microsoft Flow
  4. Real-World solutions where all the solutions are brought together.


Views: 3.93K  | Categories: MS Cloud IT Pro Podcast, Power Automate, Under The Hood
About The Author
- Nick Brattoli is an Ohio native, SharePoint MCSE, Office 365 MCSA, and self-employed Consultant. He’s worked in the IT Field for 13 years, 7 of which have been SharePoint-focused. Over the years, he’s worked in a variety of industries, such as Healthcare, Finance, Law, and Manufacturing. He currently lives in Birmingham, Alabama, and is focusing on building experience in cloud technologies. In his free time, he practices Brazilian Jiu Jitsu and works on nerdy projects.
  • dupton2000 says:

    Nick and Ben – Great session. Can you can point me to the API’s to turn on the advanced settings and change content types for document library that is created for a Team. Part of my Teams creates process is to change the document content type to a custom one that has specific Default values that I also set. Currently a manual process for each team request. Would love to automate this. I made note of your pause code as part of the creation process requires me to wait till the timer job – content types are pushed to the newly created Site. This will also be a factor.

  • Ben Stegink says:

    I know we’ve had some conversations about this in other forums, but just wanted to get the response here as well for others that may be curious. None of the sample code I showed in the video contained the PowerShell to accomplish this task. However, you should be able to accomplish this with the PnP PowerShell Module I use in several of the scripts. The have a Set-PnPList cmdlet with an -EnableContentTypes parameter. Then you can use the Add-PnPContentTypeToList to add the appropriate content types to your SharePoint List/Library. The tricky part of all of this, is like you mentioned it’s a team site. Microsoft really locks down what you can do on teams sites. You also really need to be careful that you don’t do anything to break teams when messing with the site used for the Team. I’m still playing with some PowerShell and I’ll come back with additional comments as I figure some things out. Hope that helps and feel free to reach out with additional questions.