Introduction
Microsoft Teams is the main collaboration tool in the Microsoft environment. Our organization users, management, staff, employees, and even admins can use teams to communicate and collaborate with each other. Messages also have private conversations and public conversations as well, with their fellow employees.
Steps 1. Install the Teams module/ Package to the PowerShell
Generally, Windows PowerShell does not come with all of the commands, so we need to install the Microsoft Teams PowerShell module/package.
First thing just want to make sure the Execution Policy from Restricted to RemoteSigned or Unrestricted PowerShell allows local PowerShell scripts to run.
Open the PowerShell as Administrator
- Type Set-ExecutionPolicy Unrestricted
- Type “Y” to change the execution policy
- Then press enter
Steps 2. Install Microsoft Teams Module
Type “Install-Module -name MicrosoftTeams -Force -AllowClobber”
* “AllowClobber” means if there's already a version on there, it's going to overwrite it with the newest version.
Then press enter to install the Microsoft Teams Module.
Steps 3. Connect Microsoft Teams from PowerShell
Type “Connect-MicrosoftTeams”
Then press Enter.
You have to enter the credentials to authenticate.
After Successfully authenticating, The PowerShell connected to Microsoft Teams as well.
Steps 4. Create a team
So, now you can create a team as well, using the following command line.
New-Team -DisplayName ShifaTech -Description "Team to post an article on C# corner" -Visibility Public.
Then Enter.
The team has successfully created the Microsoft Teams
Steps 5. Office portal using the web address
Go to the office portal using the web address https://portal.office.com and use your credentials to log into the portal.
After Entering the credential, the link will be redirected to the Microsoft365 home page.
Then click the App Launcher Icon.
Then click Teams, and it will open with the new tap of the browser.
Click Teams to see if the team was created by using PowerShell.
Steps 6. Manage Teams
Click the Manage Teams to add a member to the team “ShifaTech”