Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-AzADUser requires -MailNickname but parameter is not required #8220

Closed
maddieclayton opened this issue Jan 2, 2019 · 1 comment
Closed
Assignees
Labels
AAD AzAd cmdlets in Az.Resources Azure PS Team Investigate 🔍
Milestone

Comments

@maddieclayton
Copy link
Contributor

Description

New-AzADUser throws when -MailNickname is not provided, but the parameter is not required. Not sure if this parameter should be required or if there is some other issue with the cmdlet code.
PR where this issue was discovered: https://github.com/Azure/azure-powershell/pull/8212/files

Script/Steps for Reproduction

PS C:\svn\obs\azure\scripts> $SecureStringPassword = ConvertTo-SecureString -String "TxQl77FS*#m9" -AsPlainText -Force
New-AzADUser -DisplayName "dnhf01-test01" -UserPrincipalName "dnhf01-test03@xyz.onmicrosoft.com" -Password $SecureStringPassword
New-AzADUser : 'MailNickname' cannot be null.
At line:2 char:1
+ New-AzADUser -DisplayName "dnhf01-test01" -UserPrincipalName "dnhf01- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [New-AzADUser], ValidationException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ActiveDirectory.NewAzureADUserCommand

Module Version

PS C:\svn\obs\azure\scripts> Get-Module Az

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.0.1      Az

Environment Data

$PSVersionTable

Debug Output


@cormacpayne
Copy link
Member

cormacpayne commented Jan 8, 2019

This has been fixed and will be available in the next release of Az (2019-01-15).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AAD AzAd cmdlets in Az.Resources Azure PS Team Investigate 🔍
Projects
None yet
Development

No branches or pull requests

2 participants