Lead Image © vska, 123RF.com

Lead Image © vska, 123RF.com

PowerShell scripts for managing Microsoft 365 components

Master Key for the Cloud

Article from ADMIN 65/2021
By
Manage the various components of Microsoft 365 with PowerShell scripts that use modules culled from various Microsoft products.

Different components of Microsoft 365 use different portals for managing services such as Teams, SharePoint, and Exchange, making administration difficult. With an arsenal of scripts and the appropriate PowerShell modules, however, many recurring activities can be conveniently controlled from the command line.

Many companies use Microsoft Teams when it comes to enterprise collaboration. The system relies on Microsoft 365 Groups to assign permissions in Exchange, SharePoint, and in itself and to control its functions. Microsoft 365 Groups are stored in Azure AD and are managed there – including the memberships for internal and external users. It's a good idea to start with Groups.

Controlling Microsoft 365 Groups

A new Microsoft 365 group can act as a team in different ways. You can either take the Exchange PowerShell approach with

Connect-ExchangeOnline -userPrincipalName <user@example.com>
New-UnifiedGroup -DisplayName "<groupname>" -Alias "<groupalias>" -Owner <user@example.com>

or use the Azure AD PowerShell modules:

Connect-AzureAD
New-AzureADMSGroup -DisplayName "<groupname>" -MailNickname "<groupalias>" -GroupTypes "Unified" -MailEnabled $true-SecurityEnabled $true

The Unified group type identifies the Microsoft 365 groups that are used for Teams and Yammer, as well as permissions and mailing. Azure AD PowerShell distinguishes between the New-AzureADGroup and New-AzureADMSGroup cmdlets for traditional and Microsoft 365 groups, respectively.

If you have not installed the Exchange Online PowerShell cmdlets, do so in a PowerShell session as administrator and import the module as a normal user:

Install-Module ExchangeOnlineManagement
Import-Module
...
Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs



Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>
	</a>

<hr>		    
			</div>
		    		</div>

		<div class=