Syntax correction

Glenn Maxwell 10,571 Reputation points
2024-06-14T09:38:05.0033333+00:00

Hi All

can anyone help me correcting the guest account creation PowerShell syntax.

$email = "email"
$displayName = "FN LN"
$sendInviteMessage = $true
$firstName = "FN"
$lastName = "LN"
$userType = "Guest"
$companyName = "SomeCompany"
$jobTitle = "Developer"
New-AzureADMSInvitation -InvitedUserEmailAddress $email -InvitedUserDisplayName $displayName -SendInvitationMessage $sendInviteMessage -InvitedUserType 
$userType -InvitedUserOrganizations $companyName -InvitedUserJobTitle $jobTitle

Microsoft Exchange Online
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,330 questions
{count} votes

Accepted answer
  1. Miguel Gonçalves | AVANADE 886 Reputation points
    2024-06-14T22:04:49.93+00:00

    Hi Glenn Maxwell

    The New-AzureADMSInvitation cmdlet doesn’t have -InvitedUserOrganizations and -InvitedUserJobTitle parameters.

    $email = "email"
    $displayName = "FN LN"
    $sendInviteMessage = $true
    $userType = "Guest"
    New-AzureADMSInvitation -InvitedUserEmailAddress $email -InvitedUserDisplayName $displayName -SendInvitationMessage $sendInviteMessage -InvitedUserType $userType.
    

    # If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


0 additional answers

Sort by: Most helpful