【发布时间】:2020-06-15 23:13:57
【问题描述】:
此脚本创建来宾用户邀请,但在尝试将新创建的用户添加到 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 中?
【问题讨论】:
-
SPO UPS(用户配置文件服务)似乎在两天内没有运行。即使用户在 AzureAD 中,它们也不会显示在 SPO 中(即使您尝试在 GUI 中手动将用户添加到站点组)。没有像 SP Server 这样的 GUI 手动同步。这可以在PS中完成吗?这对 Extranet 客户端来说很糟糕,因为当用户接受邀请时,他们将被重定向到显示拒绝访问的站点。
-
这也是正确的,尽管 MS Graph API 中的邀请 + GET /users/id 会导致 404 大约 5-10 秒:\
-
更正:用户配置文件是在 UPS 同步周期之后添加的,但仍无法通过 GUI 添加到 SP 组。
标签: powershell sharepoint active-directory azure-active-directory sharepoint-online