Forum Discussion
Shayne Wright
Jun 16, 2017Copper Contributor
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...
- 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
Dean_Gross
Jun 16, 2017Silver Contributor
Here is one approach https://docs.microsoft.com/en-us/azure/active-directory/active-directory-b2b-code-samples and a more comprehensive article is at https://justidm.wordpress.com/2017/05/07/azure-ad-b2b-how-to-bulk-add-guest-users-without-invitation-redemption/ and