Create Office 365 User Using PowerShell

In this article I’ll show a great PowerShell script that will create an Office 365 user using Office 365 PowerShell Module without using the portal.

Before you start make sure Install the Windows PowerShell Module for Office 365 using my article and connect to Office 365 using PowerShell.

Once you have everything Installed and loaded copy the script below to ISE, fill the details In the script and run to create a new user:

Import-Module msonline

Connect-MsolService

New-MsolUser -UserPrincipalName labusr02@company.onmicrosoft.com `

-DisplayName "labuser 02" -FirstName "lab" -LastName "USER 02"

Once completed, run the cmdlet below to view all users:

Get-MsolUser


Posted

in

by