Onboarding new users in Microsoft 365 is a crucial task for IT administrators. Whether you're dealing with new employees or contractors, it's essential to ensure they have the right access to tools and resources from the start. In this guide, we'll walk you through the process of onboarding users using both the Microsoft 365 Admin Center and Graph PowerShell. We'll cover the entire workflow—from account creation to assigning licenses and group memberships—keeping it simple and straightforward.
Automation simplifies user onboarding by reducing the manual steps involved, eliminating errors, and ensuring consistency. Whether you're onboarding a few users or bulk-adding them, using tools like Graph PowerShell allows you to streamline the process, save time, and focus on other critical tasks. While the admin center is user-friendly, PowerShell offers flexibility and scalability for larger operations.
Before you can start onboarding users, ensure you have the necessary permissions and tools:
Install-Module Microsoft.Graph
Connect-MgGraph -Scopes "User.ReadWrite.All"
Option 1: Using the Admin Center
Option 2: Using Graph PowerShell
For admins managing multiple users, PowerShell is an efficient way to automate onboarding. Here's how you can do it.
New-MgUser -DisplayName "John Doe" `
-UserPrincipalName "john.doe@contoso.com" `
-MailNickname "johndoe" `
-PasswordProfile @{password = "User@123"; forceChangePasswordNextSignIn = $true} `
-AccountEnabled
Update-MgUser -UserId "ginger.doe@7xh7fj.onmicrosoft.com" -UsageLocation "US"
Get-MgSubscribedSku | Select-Object SkuId, SkuPartNumber
Script for assigning the license.
$User = Get-MgUser -UserId "john.doe@contoso.com"
$License = New-Object -TypeName Microsoft.Graph.PowerShell.Models.MicrosoftGraphAssignedLicense
$License.SkuId = "ENTER-SKU-ID-HERE" # Replace with your license SKU ID
Set-MgUserLicense -UserId $User.Id -AddLicenses @($License) -RemoveLicenses @()
New-MgGroupMember -GroupId "GROUP-ID-HERE" -DirectoryObjectId <user-id-goes-here>
Note:: Use Get-MgGroup and Get-MgUser to obtain the group id and user id respectively.
Option 1: Using the Admin Center:
Option 2: Using Graph PowerShell:
Get-MgUser -UserId "john.doe@contoso.com" | Select DisplayName, UserPrincipalName, AccountEnabled
Get-MgUserLicenseDetail -UserId $User.Id
Get-MgUserMemberOf -userid "ginger.doe@7xh7fj.onmicrosoft.com"
Onboarding new Microsoft 365 users can be made much simpler and more efficient with automation using Graph PowerShell or through the Microsoft 365 Admin Center. Whether you're dealing with a single user or hundreds, automating this process saves time and ensures that all users are properly set up with the correct licenses and group memberships.
© m365corner.com. All Rights Reserved. Design by HTML Codex