Forum Discussion

Shayne Wright's avatar
Shayne Wright
Copper Contributor
Jun 16, 2017

Bulk load Azure AD Users

Hi   We use AD Connect to sync our own AD accounts with our Azure AD, but require a method to bulk load 'in cloud' only accounts for our external users. So I have a few quick questions if you pleas...
  • Brent Ellis's avatar
    Jun 16, 2017

    Not UI, or Graph, but I use PowerShell and it is quite simple:

     

    $UserName = ""
    $Password = ""
    $SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Force
    $Credential = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $SecurePassword
    
    Connect-MsolService -Credential $Credential
    
    $NewUser = New-MsolUser -UserPrincipalName "user@company.com" -DisplayName “Test User” -FirstName “Test” -LastName “User”

    This is just for one user, just do a simple read CSV and a for loop if you want to automate a bunch

     

    All attribute options documented here:

    https://docs.microsoft.com/en-us/powershell/module/msonline/new-msoluser?view=azureadps-1.0

Resources