我有两个区域的Web应用程序。一个是使用Windows身份验证的默认区域,另一个是使用基于声明的提供程序进行身份验证的Intranet区域。使用powershell将用户添加到组
我想使用powershell将用户添加到组。现在在默认区域中,我可以很容易地完成它,因为它可以正确解决问题,但是当我尝试添加位于Azure AD的Intranet身份验证提供程序中的用户时,则无法正确解决问题。
我用这PowerShell的
$Users = "[email protected]"
$siteCollUrl = "https://test/sites/test"
$group = "powershellcreated"
$web = Get-SPWeb -identity $siteCollUrl
$web.EnsureUser($User)
Set-SPUser -Identity $User -Web $siteCollUrl -Group $group
我得到一个错误,因为它是寻找到默认区域无法解析用户。
有人可以告诉我如何可以让PowerShell将用户添加到具有不同身份验证提供程序的两个不同区域。
“https://test/sites/test”是企业内部网与天蓝色广告认证 “http://test/sites/test”是默认使用Windows身份验证 感谢
你有没有定义$用户声明提供? –
不。你怎么做...我可以去https域的区域,并通过人员选择器添加用户,但不通过PowerShell脚本。 – user1221989