Last active
December 15, 2017 16:47
-
-
Save PCfromDCSnippets/bfc55afabff7fb56bd12d9891849506b to your computer and use it in GitHub Desktop.
Create MSOL User
This file contains 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
Param ( | |
[string]$displayName = "SVC-Nework-Gateway-Updater", | |
[string]$firstName = "Network-Gateway", | |
[string]$lastName = "Updater-Account", | |
[string]$upn = "[email protected]", | |
[string]$password = "MyPassword#12345", | |
[string]$usageLocation = "US" | |
) | |
$oCred = Get-Credential -Message "Enter Admin Credentials for O365..." | |
Connect-MsolService -Credential $oCred | |
$user = New-MsolUser -DisplayName $displayName ` | |
-FirstName $firstName ` | |
-LastName $lastName ` | |
-UserPrincipalName $upn ` | |
-UsageLocation $usageLocation ` | |
-ForceChangePassword:$false ` | |
-PasswordNeverExpires:$true ` | |
-Password $password |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment