Creating a user
This recipe guides you through the process of creating a new user in your Microsoft 365 tenant using the Microsoft Graph PowerShell SDK. This is an essential task for administrators looking to onboard new employees into the organization’s digital workspace.
Getting ready
Follow the guidance in the Setting up PowerShell recipe from Chapter 1, Microsoft 365 Setup and Basic Administration, to connect to your Microsoft 365 tenant via PowerShell. Ensure you have administrative privileges on your system, as well as administrative permissions to create user profiles in your Microsoft 365 tenant such as User Administrator or Global Administrator.
How to do it…
- First, prepare the user details by defining the properties of the new user. In the simple example that follows, you’ll define
DisplayName
,UserPrincipalName
,MailNickname
, andPassword
(be sure to update with your own values):$userParams = @{ DisplayName =...