Exam AZ-104 All QuestionsBrowse all questions from this exam
Question 123

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.

After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

You have an Azure Active Directory (Azure AD) tenant named contoso.com.

You have a CSV file that contains the names and email addresses of 500 external users.

You need to create a guest user account in contoso.com for each of the 500 external users.

Solution: You create a PowerShell script that runs the New-MgInvitation cmdlet for each external user.

Does this meet the goal?

    Correct Answer: A

    Using a PowerShell script with the New-MgInvitation cmdlet for each external user listed in the CSV file will effectively create a guest user account in the Azure AD tenant for each of the 500 external users. The New-MgInvitation cmdlet sends an invitation email to each external user, and when the user accepts the invitation, their guest account is created in the directory. This approach is a valid method to achieve the goal of creating guest user accounts in contoso.com for the 500 external users.

Discussion
iamchoyOption: A

The New-MgInvitation cmdlet is part of the Microsoft Graph PowerShell module. It's used to create an invitation to an external user. When the invited user redeems their invitation, a guest user is created in the directory. If you use a PowerShell script that loops through each external user in the CSV file and runs the New-MgInvitation cmdlet for each of them, it will send out invitation emails to each of those external users. Once an external user accepts the invitation, they'll be added to the Azure AD tenant as a guest user. So, using the New-MgInvitation cmdlet in a PowerShell script for each external user does meet the goal of creating a guest user account in contoso.com for each of the 500 external users. The answer is: A. Yes

Shark006

The cmdlet New-MgInvitation requires the Redirection URL. "The URL the user should be redirected to once the invitation is redeemed. Required." Reference: https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.signins/new-mginvitation?view=graph-powershell-1.0 So the answer is: B. No

Batiste2023

As you run the command from a script, you can hardcode a redirection URL into it. A is correct, I would say!

SDiwan

the correct answer is "A". We can assume that invitation url is present in the powershell script. also, it mentions the command is used for "each" user, so assuming there is a loop and this command runs for each user inside the loop.

KillicOption: B

Correct. I believe "New-AzureADMSInvitation" is used to bulk invite guests from CSV file. Source: https://learn.microsoft.com/en-us/azure/active-directory/external-identities/bulk-invite-powershell

EdyCv

In this link you provided, the command used is actually "New-MgInvitation"... here is the complete script [$invitations = import-csv c:\bulkinvite\invitations.csv $messageInfo = New-Object Microsoft.Open.MSGraph.Model.InvitedUserMessageInfo $messageInfo.customizedMessageBody = "Hello. You are invited to the Contoso organization." foreach ($email in $invitations) {New-MgInvitation -InvitedUserEmailAddress $email.InvitedUserEmailAddress -InvitedUserDisplayName $email.Name -InviteRedirectUrl https://myapps.microsoft.com -InvitedUserMessageInfo $messageInfo -SendInvitationMessage $true }]

ggogelOption: A

There simply is no clear answer to this question! If you use the CSV in PowerShell, you would need another Cmdlet Import-Csv to read the CSV file. Then, you could iterate over the email addresses and specify the same redirection URL for every guest. On the other hand, there is the same question about using Azure Portal Bulk Import. I could also argue that I can simply open the file in Excel and set a redirection URL for every user. So it really comes down to how you interpret the question. Suppose you can just use the existing CSV and the given Cmdlet or Azure Bulk Import, then the answer is always FALSE. If you can add one extra step or Cmdlet, then it is always TRUE.

ggogel

After reading the question again, it says: "you create a PowerShell script". In my opinion, this implies that we can use other Cmdlets. So I would lean towards "YES" here.

Korny11Option: B

I would go for B. The cmdlet is correct but the required parameter "-InviteRedirectUrl" is missing in the CSV as mentioned here https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.signins/new-mginvitation?view=graph-powershell-1.0&preserve-view=true#-inviteredeemurl

ziggy1117Option: B

needs redirection URL

clg003Option: A

Yes with New-MgInvitation the -InviteRedirectUrl flag is not required. You can also put one in with the command line. "-InviteRedirectUrl Required: False" https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.signins/new-mginvitation?view=graph-powershell-1.0

ggogel

In the text explaining the parameter, it says "Required". In the tables, it says "Required: False" for every parameter, even the mail address.

bhadrisn

Selected Answer : B For "InvitedUserEmailAddress" also it states that Required: False But this is essential. So the Answer should be "B-No" where without a redirect URL you cannot invite an external user

amsiosoOption: A

By portal you need to include the Redirection URL in the csv. https://learn.microsoft.com/en-us/entra/external-id/tutorial-bulk-invite Making it with Powershell yo dont need to include in the csv the Redirection URL. If we can change New-AzureADMSInvitation for New-MgInvitation in the PowerShell script then the answer is A. https://learn.microsoft.com/en-us/entra/external-id/bulk-invite-powershell?source=recommendations#send-bulk-invitations

amsioso

Seem like Yes https://learn.microsoft.com/en-us/powershell/microsoftgraph/azuread-msoline-cmdlet-map?view=graph-powershell-1.0#users But we need to install the M Graph PowerShell SDK https://learn.microsoft.com/en-us/powershell/microsoftgraph/migration-steps?view=graph-powershell-1.0 https://learn.microsoft.com/en-us/powershell/microsoftgraph/installation?view=graph-powershell-1.0

60tiesOption: A

As per this link: “https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.signins/new-mginvitation?view=graph-powershell-1.0” The “InviteRedirectUrl” requirement is a Boolean. So can be included (as True) or ignored (as False). So A is the correct answer

Dil_12345Option: B

The New-MgUser cmdlet creates a new user account in Azure AD, not a guest user account. To create a guest user account, you need to use the New-AzureADMSInvitation cmdlet, which sends an invitation email to the external user and adds them to the tenant as a guest.

3c5adceOption: A

A. YES - using a PowerShell script with the New-MgInvitation cmdlet is an effective way to meet the requirement of creating guest user accounts for 500 external users in the contoso.com Azure AD tenant. This approach leverages the power of automation and Microsoft's API to accomplish the task efficiently and effectively.

tashakoriOption: A

Yes is correct

MatAlvesOption: A

CSV doesn't need to contain the -InviteRedirectUrl. It can be added later. https://learn.microsoft.com/en-us/entra/external-id/bulk-invite-powershell#send-bulk-invitations

mattpaulOption: A

A is correct Ping me at <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b0c0d1c5dc9eddd1c4c4d8d5c7c381898780f0dfc5c4dcdfdfdb9ed3dfdd">[email protected]</a> to get full set

e004a35Option: B

The CSV is missing a Redirect URL and the New-MgInvitation command requires it. Correct answer is No.

vsvaidOption: A

Although invitation url is not in the csv file, we can still create the user by specifying url when running the script like here https://learn.microsoft.com/en-us/entra/external-id/bulk-invite-powershell#send-bulk-invitations

Shark006Option: B

The question is: You need to CREATE a guest user account in contoso.com for each of the 500 external users. The command provided as an answer to this question is New-MgInvitation, it INVITES guest users and do NOT create users. Answer is B: No. Reference: https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.signins/new-mginvitation?view=graph-powershell-1.0

Shark006

The answer is B but the justification is wrong after reconsideration. "The URL the user should be redirected to once the invitation is redeemed. Required." Reference: https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.signins/new-mginvitation?view=graph-powershell-1.0

VestibalOption: B

La respuesta correcta es la B. In this quickstart, you’ll use the New-MgInvitation command to add one guest user to your Azure tenant. Habla de un usuario, en singular. Además, la documentación oficial los ejemplos es de un usuario, no de forma masiva como es la pregunta. https://learn.microsoft.com/en-us/azure/active-directory/external-identities/b2b-quickstart-invite-powershell https://learn.microsoft.com/en-us/azure/active-directory/external-identities/bulk-invite-powershell