cli-microsoft365
cli-microsoft365 copied to clipboard
New command: Create guest user in the tenant
Usage
m365 aad user guest add
Description
A Command to create guest user in the Tenant
Options
Option | Description |
---|---|
--emailAddress <emailAddress> |
Email address of the Guest User |
--displayName [displayName] |
Display name of the Guest User |
--sendInvitationMessage |
Specify if you want to send invitation message while inviting the Guest user. If not specified, email will not be sent by Azure AD |
--inviteRedirectUrl [inviteRedirectUrl] |
Redirect URL which will be there in the Invite message. If not specified, default URL https://myapplications.microsoft.com will be set. |
--welcomeMessage [welcomeMessage] |
Personal welcome message which will be added in the email along with the default Email. |
Additional Info
More details on the API : https://docs.microsoft.com/en-us/graph/api/invitation-post?view=graph-rest-1.0&tabs=http
Hello @pnp/cli-for-microsoft-365-maintainers - Any suggestions to the spec for creating the guest user.
What about extra optional options like firstName
, lastName
and personalMessage
(in case sendInvitationMessage
is true?)
As of now in the InvitationObject there are no properties available for firstname
, lastname
etc.
But personalMessage
option is something which could be added along with the options. Nice suggestion π.
That's true, but we can probably modify the user object after the user invitation has been created. That being said, the firstname and lastname properties are not that important to me. So maybe just exlcude them.
Great suggestion! Shall we change sendInvitationMessage
to a flag as we don't need an explicit false
on it? Also, I noticed it's included twice in the list of options: is there a reason for it?
great idea π
I was wondering if it is also possible to include those properties from invitation object as well πhttps://docs.microsoft.com/en-us/graph/api/resources/invitation?view=graph-rest-1.0
what do you think π€?
inviteRedirectUrl
is required so it seems like something we need to have. inviteRedeemUrl
is read-only so I'm not sure if we can do anything with it. What would be the use case for setting the status
(assuming that it's even possible)?
yes.. I guess from the marked params only inviteRedirectUrl
makes sense ππ
Thanks for the review on the specs.
Shall we change sendInvitationMessage to a flag as we don't need an explicit false on it? Also, I noticed it's included twice in the list of options: is there a reason for it?
Have updated sendInvitationMessage
to be a flag which make sense rather than having a boolean one π. Duplicate options was because of a "copy-paste" error. My bad π€¦ββοΈ.
Have updated the specs.
I was wondering if it is also possible to include those properties from invitation object as well
Like commented by Waldek rest of the options seems to be either Read-only or not applicable and hence have avoided those.
Making the issue available to be picked up.
Am I missing something, or is welcomeMessage
not in the API docs? π
Am I missing something, or is
welcomeMessage
not in the API docs? π
Guess the properties are there here, where you can setup welcome message. There is a property called invitedUserMessageInfo
in the request props if I am not mistaken
Aw my bad, I read sendInvitationMessage
as invitationMessage
and was a bit confused what the difference was with welcomeMessage
. My bad, sorry for the hassle π
Aw my bad, I read
sendInvitationMessage
asinvitationMessage
and was a bit confused what the difference was withwelcomeMessage
. My bad, sorry for the hassle π
No problem at allπ. Always good to ask questions when in doubt before starting development.