Forum Discussion
Adam Fowler
Mar 19, 2017Iron Contributor
Azure AD B2B Inviting
Hi, There's been a lot of changes with Azure AD B2B and I wanted to see if anyone had already implemented a method to let internal users invite external accounts themselves? There's both PowerSh...
Adam Fowler
Mar 23, 2017Iron Contributor
I've now found out that script won't work for inviting people who are using a public email account such as gmail or hotmail, as it parses the email address differently.
Thankfully I can cut out a step and just use an object from inside an object inside an object :)
$group = get-azureadgroup -SearchString "Sharepoint Online Testsite" | where {$_.dirsyncenabled -eq $null}
$newuser = New-AzureADMSInvitation -InvitedUserEmailAddress testy@contoso.com -InvitedUserDisplayName "Full Name" -sendinvitationmessage $true -InviteRedirectUrl "http://myapps.microsoft.com/"
Add-AzureADGroupMember -objectid $group.objectid -RefObjectId $newuser.InvitedUser.Id
Ianoo335
Jun 05, 2020Copper Contributor
Thank you very much for this post, was extremely helpful in my work.
I do have a question though. How can I get the objectID of an invited user outside the scope of this script?
For example, if I had already invited a user but then I want to create a separate script which calls for an objectID of a given invited user and then, let's say, add them to a group.
I do have a question though. How can I get the objectID of an invited user outside the scope of this script?
For example, if I had already invited a user but then I want to create a separate script which calls for an objectID of a given invited user and then, let's say, add them to a group.