Add a user to the Office 365 portal

Create One User in the Portal

  • To create One user in the portal
  • Navigate to the Office 365 Portal > Users > Active Users > Click on and create a new user

PowerShell:

  • Connect to Office 365 using “Windows Azure Active Directory Module for Windows PowerShell” as Admin

Connect-MsolService

The finished command will look similar to:

New-MsolUser -UserPrincipalName “powershell@spodawgs.onmicrosoft.com” -City “Mumbai” -State “MH” -Country “India” -DisplayName “PowerShell”

Additional Parameters:

New-MsolUser -DisplayName <string> -UserPrincipalName <string>

[-AlternateEmailAddresses <string[]>] [-AlternateMobilePhones <string[]>]

[-BlockCredential <Boolean>] [-City <string>] [-Country <string>] [-Department

<string>] [-Fax <string>] [-FirstName <string>] [-ForceChangePassword <Boolean>]

[-ImmutableId <string>] [-LastName <string>] [-LicenseAssignment <string[]>]

[-LicenseOptions <LicenseOption[]>] [-MobilePhone <string>] [-Office <string>]

[-Password <string>] [-PasswordNeverExpires <Boolean>] [-PhoneNumber <string>]

[-PostalCode <string>] [-PreferredLanguage <string>] [-State <string>]

[-StreetAddress <string>] [-StrongPasswordRequired <Boolean>] [-TenantId <Guid>]

[-Title <string>] [-UsageLocation <string>] [<CommonParameters>]

More Information:

https://blogs.technet.microsoft.com/heyscriptingguy/2014/08/04/use-powershell-to-create-bulk-users-for-office-365/

Adding Users in Bulk

To add users in bulk > Navigate to the Office 365 Portal

  • Users > Active Users > Click on the icon > Download a blank CSV file > add your users to it “The column headings in your file must match the column headings in the sample”
  • Note: A single CSV file can contain up to 250 users. If you have more than 250 then reduce the number of users in your CSV file or create multiple smaller files and try again.
  • Browse to the location of your file > Select it and upload
  • Fill in the rest of the details > Finish
  • All the users will be created in Office 365

PowerShell:

Connect to Office 365 using “Windows Azure Active Directory Module for Windows PowerShell” > Run as Admin

Run the following command to connect: Connect-MsolService

  • Note: Change the Path and the Names for each column to match the parameters in the Commands below

$users = Import-Csv C:\Users\Clint\Downloads\Import_User_Sample_en.csv

$users | ForEach-Object {New-MsolUser -UserPrincipalName $_.UserPrincipalName -FirstName $_.firstname -LastName $_.lastname -DisplayName $_.DisplayName -Title $_.title -Department $.department -City $_.city -State $_.State -Country $_.Country}

Additional Parameters:

New-MsolUser -DisplayName <string> -UserPrincipalName <string>

[-AlternateEmailAddresses <string[]>] [-AlternateMobilePhones <string[]>]

[-BlockCredential <Boolean>] [-City <string>] [-Country <string>] [-Department

<string>] [-Fax <string>] [-FirstName <string>] [-ForceChangePassword <Boolean>]

[-ImmutableId <string>] [-LastName <string>] [-LicenseAssignment <string[]>]

[-LicenseOptions <LicenseOption[]>] [-MobilePhone <string>] [-Office <string>]

[-Password <string>] [-PasswordNeverExpires <Boolean>] [-PhoneNumber <string>]

[-PostalCode <string>] [-PreferredLanguage <string>] [-State <string>]

[-StreetAddress <string>] [-StrongPasswordRequired <Boolean>] [-TenantId <Guid>]

[-Title <string>] [-UsageLocation <string>] [<CommonParameters>]