Azure

Learn how to Create a Crew in Microsoft Groups Utilizing Powershell in Azure Automation

Introduction

 

Azure Automation supplies a cloud-based automation and configuration service that gives constant administration throughout your Azure and non-Azure environments. Azure Automation helps to automate frequent, time-consuming, and error-prone cloud administration duties. It consists of course of automation, replace administration, and configuration options. 

 

Use case/Enterprise State of affairs

 

Within the case that we have to prohibit the customers by creating groups on their very own and must arrange some provisioning course of round this, then we have to go together with both PowerShell or Graph API. We’d must schedule this as a job that may get all of the requests (new Crew requests) raised by the customers and provision the groups accordingly after some approval course of. For this, we are able to use Azure Automation to schedule the job which executes the PowerShell script periodically to provision the groups.

 

Azure Automation lets you save time, cut back value & errors and improve effectivity. Check with this hyperlink to be taught extra about pricing particulars.

 

On this article, you will notice methods to carry out the next duties:

  • Create an Automation Account
  • Create Credential Asset – To retailer the credentials which will likely be utilized by PowerShell for authentication.
  • Import PowerShell Module – Import Microsoft Groups PowerShell Cmdlets module with the intention to entry Groups Cmdlets.
  • Create PowerShell runbook – Script to create a brand new crew
  • Take a look at and publish the runbook

Create an Automation Account

  1. Navigate to the Azure portal.
  2. Click on on Create a Useful resource.

  1. Seek for Automation and choose Automation. Click on Create.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. Enter all of the required particulars and click on Create.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. As soon as it’s deployed efficiently, navigate to the useful resource.
  2. Check with this hyperlink to know extra in regards to the Automation account.

Create credential asset

 

With a purpose to run the PowerShell runbook, we’d like the credentials resembling a person identify and password for authentication. These safety credentials might be saved in an Azure Automation. Check with this hyperlink to be taught extra about credential property in Azure Automation.
  1. Navigate to Automation account created within the earlier step.
  2. Beneath Shared Sources, click on Credentials.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. Click on Add a credential.
  2. Enter all of the required particulars and click on Create.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. Credential property created efficiently. Copy the identify in a notepad which will likely be used within the PowerShell to get the credentials.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

Import PowerShell Modules

 

With a purpose to create a crew in Microsoft Groups utilizing PowerShell, we have to set up the Microsoft Groups Cmdlets module. Azure Automation supplies the power to import PowerShell modules into your Automation Account for use by the PowerShell based mostly runbooks.

  1. Navigate to Automation account.
  2. Beneath Shared Sources, click on Modules.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. Click on Browse Gallery. Seek for Groups and choose MicrosoftTeams

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. Click on Import to import the Groups PowerShell Module.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. It would take a couple of minutes to import the module.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. As soon as the module is imported efficiently, all of the accessible cmdlets will likely be displayed.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

Create PowerShell runbook

 

Azure Automation helps a number of kinds of runbooks. We’re going to see how we are able to create the PowerShell runbook with the intention to provision a crew in Microsoft Groups.

 

Check with this hyperlink to know extra about runbook varieties.
  1. Navigate to Automation account.
  2. Beneath Course of Automation, click on Runbooks.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. Click on Create a runbook.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. Enter the required particulars 

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. Within the Edit pane, copy and paste the beneath script.
    1. # Get the credential from Automation  
    2. $credential = Get-AutomationPSCredential -Identify ‘TeamsAdminCredential’  
    3. $userName = $credential.UserName  
    4. $securePassword = $credential.Password  
    5.   
    6. $psCredential = New-Object –TypeName System.Administration.Automation.PSCredential –ArgumentList $userName, $securePassword  
    7.  
    8. # Join to Microsoft Groups  
    9. Join-MicrosoftTeams -Credential $psCredential  
    10.  
    11. # Create a new Crew  
    12. New-Crew -DisplayName “Demo Crew – AZ Automation”  
    13.  
    14. # Disconnect from Microsoft Groups  
    15. Disconnect-MicrosoftTeams  
  1. Click on Save.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

Take a look at and publish the runbook

  1. Navigate to Automation account.
  2. Beneath Course of Automation, click on Runbooks.
  3. Click on the newly created runbook (named as CreateTeam).
  4. Click on Edit.
  5. Click on Take a look at pane to check the runbook.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. Click on Begin.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. Script ran efficiently, as proven beneath.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. The crew was created efficiently, as proven beneath.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. Shut this window by clicking the shut (X) icon on the prime proper nook of the web page.
  2. Publish the runbook.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. Runbook efficiently printed, as proven beneath.

    How To Create A Team In Microsoft Teams Using Powershell In Azure Automation

  1. Based mostly on the necessities, this PowerShell runbook might be scheduled by clicking Hyperlink to Schedule.

Abstract

 

Thus, on this weblog, you noticed methods to create a crew in Microsoft Groups utilizing PowerShell in Azure Automation.

Show More

Related Articles

Leave a Reply

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

Back to top button