How to create Microsoft 365 groups in bulk with sharepoint site and Teams using Powershell

microsoft 365 groups

About the Task This week I received a request to create Microsoft 365 groups in bulk using Powershell. I tried to use New-UnifiedGroup command (part of EXO V2 Powershell Module) to create Microsoft 365 group which worked fine for creation of the group but this command did not create corresponding Sharepoint site. Therefore, I utilized New-PnPMicrosoft365Group command (part of PnP.Powershell powershell module). In this blog post, I have explained in detail on how to use New-PnPMicrosoft365Group command and create Microsoft 365 group(s). First Step is to Install PnP.Powershell Module and authenticate using Connect-PnPOnline to Sharepoint before we can run New-PnPMicrosoft365Group cmdlet. There are many different ways you can authenticate to …

Read more

Export Users DisplayName, UsageLocation, UserPrincipalName, MFA Status, StrongAuthInfo, DefaultAuthMethod from office 365 / Azure AD using PowerShell in CSV

You can export Office365 users DisplayName, UsageLocation, UserPrincipalName, MFA Status, StrongAuthInfo, DefaultAuthMethod using powershell. The exported data will be in a CSV File which will list these details. Default MFA Method is useful when you want to know who in your company is using which MFA method to authenticate to office365 services. For example, this data is also useful when you are planning to move the users from SMS based method to Phone App Method which is more secure. The PhoneAppNotification method means when users will get notification in MS Authenticator App and they tap on approve to confirm sign-in. First you need to download / Install MSOnline powershell module …

Read more

Exchange Online / Exchange 2010 useful PowerShell Commands

Export the Access Rights / Permissions assigned to All user mailboxes in Office365. Export the Access Rights / Permissions assigned to All Shared Mailboxes in Office365 Export the Access Rights / Permissions assigned to All Shared Mailboxes in Office365 (Another Variation to Export only relevant information) List the Access Rights / Permissions for a user on all other mailboxes (Below command will list the full mailbox permissions which user1 have on all other mailboxes) Export the Access Rights / Permissions for the Calendar Folder of all User Mailboxes. Another way to List Calendar Permissions You can filter the Calendar Folder Permissions to only list it for a particular user e.g. John. …

Read more

How to apply Tags on all Azure resources using PowerShell

You can use the tags to logically organize all the resources in Azure. Tag in azure is a name and value pair which can be applied using GUI or by using PowerShell. You can take the approach of GUI if there are not too many resources where you have to manage the tags. In that case, you can click on each resource and then click Tags (as shown in below screenshot) on the left hand side pane and fill the details for Name/Value Pair. While this method is manual and also requires a lot of time if the number of resources where the tags needs to be populated increases from …

Read more

Office365/Exchange Online – Messages are not moving to Archive Mailbox after Applying Retention Policy | Litigation Hold | Retention Hold

Recently came across an issue where we had applied the Mailbox Retention Policy for all the users but for some of the users, emails were not getting moved to Online Archive Mailbox. After investigating on this issue, it was identified that the retention hold was enabled on these users mailbox which was not allowing the messages to move to Archive Mailboxes. I have used below commands to check the Retention Hold value for the users and updated this value to fix the issue. “Placing a mailbox on retention hold suspends the processing of an MRM retention policy by the Managed Folder Assistant for that mailbox. Retention hold is designed for …

Read more

How to disable a particular service or license for example Teams from office 365 assigned license plan using Powershell

When you assign office 365 license to a user, office 365 services are available to the users like Teams or SharePoint etc. You can enable or disable a specific license for an office 365 account or all office 365 accounts using powershell. Steps: 1) Open Powershell and connect to MSOnline Powershell Module using command connect-msolservice. If you do not have MSOnline Module Installed, you can download it by clicking on MSOnline Offline Installer. Follow the instructions to install the Package Install Powershell Module Manually or use command Install-Module MSOnline to install the module. Please install or import this module on windows powershell as msol commands are not supported on Powershell core. 2) Find the AccountSKUID using below command. …

Read more

How to set calendar permissions on Exchange Online User Mailboxes for list of users given in CSV File using Powershell

Sharing a script to Set/Apply the Calendar permissions on list of users as mentioned in the CSV File. Please see the format of the CSV file. I created and utilized the script when i migrated Exchange 2010 users to Office 365. Exported the Calendar Permissions of all the users from Exchange 2010 and then saved it in a csv file (as you can see in below screenshot) and Applied the permissions using this script. Please see the screenshots and use the help information in the script to know more details. The Script will try to establish connection with Office365 first. Please provide appropriate username and password to provide relevant permissions to execute this …

Read more

Powershell – Applying Licenses to list of users on Office 365

Summary: Whether the users are provisioned via Azure AD Connect Sync or directly on office 365 cloud (In-Cloud Users). We need to allocate and assign the licenses to the users to get certain features and functionality enabled for them. e.g. For working with Exchange Online, Once you have sync’ed the user to office365, you can assign appropriate license (e.g. Office 365 E3 or office 365 Business Premium etc.) depending upon the plan you purchased from Microsoft to get their mailbox created in Exchange Online. You can assign the licenses via GUI or using Powershell as shown below: ✨GUI Method Assign a license using GUI is simple: just Select the user on office …

Read more

Powershell – Export the list of users and assigned licenses from Microsoft 365

Summary: PowerShell Commands to determine the Office 365 Licenses that have been assigned to users. Connect to Exchange Online (EXO) Connect to Azure Active Directory (Azure AD) List the SKUs (Stock keeping units) that the company Owns using Get-MsolAccountSku Export the Users with Licenses assigned to them to a CSV file References:  Product names and service plan identifiers for licensing