How to Pass User Object to New-EntraInvitation in Entra Module #1552
Unanswered
arunnsrinivasan-web
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We are currently using the New-AzureADMSInvitation command from the AzureAD module to convert a user type from Member to Guest without deleting the user object in Azure AD. This approach works fine so far. However, when exploring the Entra module, I found the New-EntraInvitation command as an alternative. The issue is that this command does not allow passing a Microsoft.Open.MSGraph.Model.User object as input for the -InvitedUser parameter.
Question:
Is there a supported method or object type that can be passed to the -InvitedUser parameter in New-EntraInvitation? If so, what is the correct way to construct or retrieve that object?
Error Details
When I try to capture the user object value in a variable using:
$MSGraphUser = New-Object Microsoft.Open.MSGraph.Model.User -ArgumentList ""
I get the following error:
New-Object : Cannot find an overload for "User" and the argument count: "1".
At line:1 char:16
AzureAD command:
New-AzureADMSInvitation -InvitedUserEmailAddress "" -SendInvitationMessage $False -InviteRedirectUrl "http://teams.office.com" -InvitedUser $msGraphUser
Entra command:
New-EntraInvitation -InvitedUserEmailAddress $($EntraUser.Mail) -InviteRedirectUrl "http://teams.office.com" -SendInvitationMessage $false InvitedUser $msGraphUser
What I’m Looking For
The correct way to pass a user object to New-EntraInvitation.
Any documentation or examples for handling this scenario in the Entra module.
Beta Was this translation helpful? Give feedback.
All reactions