Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SharePoint PowerShell网站权限_Sharepoint_Powershell - Fatal编程技术网

SharePoint PowerShell网站权限

SharePoint PowerShell网站权限,sharepoint,powershell,Sharepoint,Powershell,我想授予域用户对网站的SharePoint权限。 SharePoint中的peoplepicker找到了该用户,我可以在浏览器中将该用户添加到网站。 但是,当我使用PowerShell时,该用户不在SharePoint GUI的权限列表中 PS: New-SPUser -UserAlias "test\TestUser2" -PermissionLevel Contribute -web http://test.sharepoint.de/site/page PS: UserLogin

我想授予域用户对网站的SharePoint权限。 SharePoint中的peoplepicker找到了该用户,我可以在浏览器中将该用户添加到网站。 但是,当我使用PowerShell时,该用户不在SharePoint GUI的权限列表中

PS: New-SPUser -UserAlias "test\TestUser2" -PermissionLevel Contribute -web http://test.sharepoint.de/site/page

PS:
UserLogin            DisplayName         
---------            -----------         
TEST\testuser2       TestUser2  
也不起作用:

Get-SPWeb "http://test.sharepoint.de/site/page" | New-SPUser –UserAlias "test\TestUser2" -PermissionLevel Contribute

如果从命令中删除页面,会发生什么情况

New-SPUser -UserAlias "test\TestUser2" -PermissionLevel Contribute -web http://test.sharepoint.de/site

另外,在通过GUI添加它们之后,您的命令是否可以将它们添加到其他站点?另外,可能是一个愚蠢的问题,但您是否以有权向站点添加用户的用户身份运行PS?

应该是这样的:
Set SPUser-Identity'domain\name'-Webhttp://sp2test/site -AddPermissionLevel读取

尝试在“Microsoft.SharePoint.PowerShell”中添加AddPSSNapin 它对我有用

Add-PSSnapin "Microsoft.SharePoint.PowerShell"
Set-SPUser -Identity 'domain\name' -Web http://sp2test/site -AddPermissionLevel Read

我认为不允许您在页面上向用户授予权限,当您在页面上获得SPWeb对象时,您将无法获得正确的上下文,为此,您可能需要访问页面对象并中断权限继承,然后才能向用户授予权限。不,该命令在其他站点上不起作用。脚本在具有完全权限的VM上使用管理员帐户运行。我只想将SharePoint用户添加到spweb。我使用:New spweb-模板“STS#0”-UniquePermissions创建spweb