Created
March 7, 2019 13:43
-
-
Save beckettkev/da5f86207f2c1fb4b7c8adb8cc056f72 to your computer and use it in GitHub Desktop.
Creates a bunch of users in a tenant, given a csv file full of users
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Install-Module MSOnline | |
$users = ipcsv ./CreateDemoUsers.csv; | |
Connect-MsolService | |
$users | ForEach-Object { | |
Write-Host "Adding $($_.DisplayName)..." -foregroundcolor green; | |
$user = $_.psobject.properties | % { $ht = @{} } { $ht[$_.Name] = $_.Value } { $ht }; | |
$user.PasswordNeverExpires = $true; | |
New-MsolUser @user; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment