如何创建来宾 AD 用户邀请,然后在 PowerShell 中添加到 SharePoint Online 网站
How to create guest AD user invitation then add to a SharePoint Online site in PowerShell
此脚本创建来宾用户邀请,但在尝试将新创建的用户添加到 SharePoint Online 网站时出错并出现以下错误:
Add-SPOUser : 找不到指定的用户 janedoe@email.com。
$tenant = "companyname"
Connect-SPOService -url "https://$tenant-admin.sharepoint.com"
Connect-AzureAD -TenantDomain "$tenant.onmicrosoft.com"
New-AzureADMSInvitation -InvitedUserDisplayName "Jane Doe" -InvitedUserEmailAddress "janedoe@email.com" -InviteRedirectURL "https://$tenant.sharepoint.com/sites/client1" -SendInvitationMessage $true
Start-Sleep -s 60
Add-SPOUser -Group "Client Site 1 Visitors" –LoginName "janedoe@email.com" -Site "https://$tenant.sharepoint.com/sites/client1"
Disconnect-SPOService
Disconnect-AzureAD
Azure AD 将该用户填充到 Office 365 需要多长时间?
尝试通过 GUI 将外部用户电子邮件(租赁外)添加到 SP 组时,按 Tab 键离开会显示以下错误:
"Your organization's policies don't allow you to share with these users. Go to External Sharing in the Office 365 admin center to enable it."
要解决此问题和 PS 脚本错误,在创建您的外联网 SP 站点后 运行 在连接到 SPO 后执行以下 PS 命令(只需要 运行 ONCE 在将外部用户添加到站点之前):
Set-SPOSite -identity https://companyname.sharepoint.com/sites/client1 -sharingcapability ExternalUserAndGuestSharing
现在 PS 脚本可以正常运行。不需要启动睡眠。
此脚本创建来宾用户邀请,但在尝试将新创建的用户添加到 SharePoint Online 网站时出错并出现以下错误:
Add-SPOUser : 找不到指定的用户 janedoe@email.com。
$tenant = "companyname"
Connect-SPOService -url "https://$tenant-admin.sharepoint.com"
Connect-AzureAD -TenantDomain "$tenant.onmicrosoft.com"
New-AzureADMSInvitation -InvitedUserDisplayName "Jane Doe" -InvitedUserEmailAddress "janedoe@email.com" -InviteRedirectURL "https://$tenant.sharepoint.com/sites/client1" -SendInvitationMessage $true
Start-Sleep -s 60
Add-SPOUser -Group "Client Site 1 Visitors" –LoginName "janedoe@email.com" -Site "https://$tenant.sharepoint.com/sites/client1"
Disconnect-SPOService
Disconnect-AzureAD
Azure AD 将该用户填充到 Office 365 需要多长时间?
尝试通过 GUI 将外部用户电子邮件(租赁外)添加到 SP 组时,按 Tab 键离开会显示以下错误:
"Your organization's policies don't allow you to share with these users. Go to External Sharing in the Office 365 admin center to enable it."
要解决此问题和 PS 脚本错误,在创建您的外联网 SP 站点后 运行 在连接到 SPO 后执行以下 PS 命令(只需要 运行 ONCE 在将外部用户添加到站点之前):
Set-SPOSite -identity https://companyname.sharepoint.com/sites/client1 -sharingcapability ExternalUserAndGuestSharing
现在 PS 脚本可以正常运行。不需要启动睡眠。