Microsoft Office 365Powershell

Effortless User Account Creation in Office 365 with PowerShell: Single & Bulk User Setup Guide

Introduction

If you manage user accounts in Office 365, PowerShell can be your best friend. This guide will walk you through creating both single and multiple user accounts in Office 365 using PowerShell. By the end, you’ll be a pro at efficiently handling user management in your Office 365 environment.

Target Audience

Step-by-Step Instructions

Step 1: Accessing PowerShell

  1. Find PowerShell on your system (usually in the Start menu).
  2. Right-click on PowerShell and select “Run as administrator.”

Step 2: Connect to Office 365

$UserCredential = Get-Credential
Connect-MsolService -Credential $UserCredential

Single Account Creation

Step 3: Create a Single User Account

Use this PowerShell script, replacing the placeholders with the new user’s details:

New-MsolUser -UserPrincipalName user@domain.com -DisplayName "User Name" -FirstName "First" -LastName "Last" -Password "Password" -LicenseAssignment "Enter-License-SKU"

Multiple Account Creation from CSV

Step 3: Prepare CSV File

  • Create a CSV with these column headers: UserPrincipalName, DisplayName, FirstName, LastName, Password, LicenseAssignment.
  • Add a row for each user, filling in their details correctly.

Step 4: Bulk Create User Accounts

Run this PowerShell script (make sure to replace the CSV path):

$UserList = Import-Csv C:\Path\to\CSV\File.csv
foreach ($User in $UserList) {
    New-MsolUser -UserPrincipalName $User.UserPrincipalName -DisplayName $User.DisplayName -FirstName $User.FirstName -LastName $User.LastName -Password $User.Password -LicenseAssignment $User.LicenseAssignment
}

Helpful Tips

  • Double-check your CSV! Errors there will mess up the bulk creation.
  • Know your license SKUs. You’ll need them for assigning licenses.

Summary

Effortlessly create user accounts in Office 365 using PowerShell, whether setting up a single user or multiple users from a CSV file. This guide empowers you to efficiently manage user accounts within your Office 365 environment. For further insights on managing user licenses, refer to our article “Bulk Assign Office 365 User Licenses with PowerShell: Step-by-Step Guide.

Recommended For You:  Automating Hyper-V Integration Services Updates with PowerShell

Muhammad Faizan

Hi, My name is Muhammad Faizan and i have spent last 15 years working as System Administrator mainly with Microsoft Technologies. I am MCSE, MCTP, MCITP, certified professional. I love scripting and Powershell is the scripting language i am in love with.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also
Close
Back to top button