Hello,
I have tried adding an email authentication method while creating a new user via the New-MgUser command. At the current time, it looks like this:
New-MgUser -DisplayName 'Test User' -Surname 'User' -GivenName 'Test' -AccountEnabled -OtherMails '******@something.eu' -UserPrincipalName '[email protected]' -PasswordProfile $PasswordProfile -MailNickname 'test.user'
No matter what I tried I could not set an email authentication method via -Authentication parameter... I have tried adding brackets and reordering but nothing worked. I do not fully understand the notes regarding this parameter which can be found in the documentation and moreover, there is no example of how to do this. Therefore, I settled on using this command instead so far:
New-MgUserAuthenticationEmailMethod -UserId '[email protected]' -EmailAddress '******@something.eu'
This one works perfectly, but I would still like to condense everything into one command which I can execute at once. Would you please give me an example of how is the command supposed to look?
Thank you