首页 文章

远程调用SharePoint Import-SPWeb cmdlet时拒绝访问

提问于
浏览
0

我目前正在尝试通过Import-SPWeb PowerShell cmdlet将SharePoint 2013网站导入单个服务器场 . 这是一个非常简单的过程,除了我需要使用Invoke-Command从另一台机器远程执行此操作 . 此远程计算机调用Invoke-Command并在SharePoint服务器上调用以下脚本,我称之为SPOINT13SSS .

您将在下面找到调用和脚本的内容 .

CALL(从远程机器到SPOINT13SSS):

Invoke-Command -ComputerName SPOINT13SSS.sandbox.local -Authentication CredSSP -Credential $spusercreds[0] -ArgumentList "SPOINT13SSS" -FilePath C:\Users\rsmith\Desktop\SPScripts\Framework\Create\Create_SPSite.ps1

脚本:

$spserver = $args[0]

Add-PSSnapin Microsoft.SharePoint.Powershell

Write-Host "[INFO] SP Server is $spserver"
Write-Host "[INFO] Beginning Import of the Site Collection into SharePoint for testing..."

try{Import-SPWeb http://$spserver -Path C:\SP13Install\siteexport.cmp -UpdateVersions Overwrite}
catch{Write-Error "[ERROR] Importing the Site Collection failed. Please make sure that the siteexport.cmp file exists and that you have proper access permissions to both the file and the SharePoint database."}

我遇到的问题 - 我跑的时候

Import-SPWeb http://$spserver -Path C:\SP13Install\siteexport.cmp -UpdateVersions Overwrite

在SPOINT13SSS上,导入工作正常,没有缺陷 .

但是,当我远程运行它时,我收到以下错误:

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
+ CategoryInfo          : InvalidData: (Microsoft.Share...CmdletImportWeb:SPCmdletImportWeb) [Import-SPWeb], UnauthorizedAccessException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletImportWeb
+ PSComputerName        : SPOINT13SSS.sandbox.local

我确保通过CredSSP进行身份验证的用户具有以下权限:

  • 农场管理员

  • 网站集管理员

  • SPOINT13SSS上的本地管理员

我也100%确定凭据是正确的,因为我有其他脚本通过这个PSCredential通过Invoke-Command调用,它们工作正常 .

此外,我还试图摆弄C:\ SP13Install \ siteexport.cmp(Everyone - Access Full控件)上的NTFS权限,并且可以't seem to get this to work. I also attempted to share the folder. I can access it from the remote machine, read and write to it, but I just can' t从远程机器调用此命令到SPOINT13SSS .

1 回答

  • 0

    我通过将帐户指定为网站集所在的Web应用程序池的服务帐户并通过iisreset / noforce重置IIS来解决了该问题

相关问题