4

I have a *.sharepoint.com tenant provisioned through singing up for Office 365. Is there a way to create a new user for the tenant using PowerShell (for SharePoint Online)?

This would normally be done manually by going to the admin panel and going through the options to create a new user (for O365 and Exchange, etc.).

2 Answers 2

2

This is done by the PowerShell Script New-MsolUser either by adding the user without a license:

New-MsolUser 
-UserPrincipalName [email protected] 
-DisplayName "Jamie Warner" 
-FirstName "Jamie" 
-LastName "Warner"

Or with a license

New-MsolUser 
-UserPrincipalName [email protected] 
-DisplayName "Dominique Trujillo" 
-FirstName "Dominique" 
-LastName "Trujillo" 
-UsageLocation "US" 
-LicenseAssignment "Contoso:BPOS_Standard"

Be sure to install the Azure AD Module first

1
  • 1
    Link to download the Azure AD module here (I was typing up an answer myself, then saw that someone already posted one)
    – wjervis
    Feb 27, 2015 at 13:17
1

First, Install Microsoft Online Services Sign-In Assistant.

Then, Run this Powershell :

Connect-MsolService

Get-MsolAccountSku

$val = Get-MsolAccountSku |ForEach-Object {;$_.AccountSkuId;}
$mytnt = $val.Split(":")[0]


New-MsolUser -DisplayName "John Smith" -FirstName "John" -LastName "Smith" -UserPrincipalName [email protected] -Department Operations -UsageLocation US -PassWord myPassword -LicenseAssignment $val

echo "User created successfully"

Pause

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.