0

ビルド サーバーからリモート PowerShell 経由で sharepoint 2013 の展開を自動化しようとしています。(Microsoft.SharePoint.Publishing、Microsoft.SharePoint.Publishing.Navigation.WebNavigationSettings)などのsharepoint dllの一部のクラスと関係がある場合を除いて、すべてが期待どおりに実行されます

同じ資格情報で同じスクリプトをローカルで実行すると、正常に実行されます。

以下を検討しました。

  1. ユーザーは両方のマシンで完全な管理者権限を持っています
  2. リモートサーバーでUACを無効にしました
  3. この投稿 ( http://social.technet.microsoft.com/Forums/sharepoint/en-US/09b60466-5432-48c9-aedd-1af343e957de/user-cannot-be-found-when- using-invokecommand-newspsite-on-sharepoint )
  4. レジストリを介してデフォルトで管理者として実行するように PowerShell を設定しました ( New-Item -Path "Registry::HKEY_CLASSES_ROOT\Microsoft.PowershellScript.1\Shell\runas\command" -Force -Name '' -Value '"c:\windows\system32\windowspowershell\v1.0\powershell.exe" -noexit "%1"')

スクリプト コード:

  #Set the radio buttons value
    $settings = New-Object Microsoft.SharePoint.Publishing.Navigation.WebNavigationSettings (,$rootWeb)
    $settings.GlobalNavigation.Source = [Microsoft.SharePoint.Publishing.Navigation.StandardNavigationSource]::PortalProvider
    #Set the radio buttons value
    $settings.CurrentNavigation.Source = [Microsoft.SharePoint.Publishing.Navigation.StandardNavigationSource]::PortalProvider

    write-host "I am here.........................."

    $settings.Update()

    #Set the Publishing Web
    $SPPubWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($rootWeb)

    #Global Navigation Settings
    $SPPubWeb.Navigation.InheritGlobal = $false
    $SPPubWeb.Navigation.GlobalIncludePages = $false

リモート Powershell の出力は次のとおりです。

I am here..........................
Exception calling "Update" with "0" argument(s): "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : UnauthorizedAccessException
    + PSComputerName        : Contoso-DEVSP

Exception setting "GlobalIncludePages": "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
    + CategoryInfo          : NotSpecified: (:) [], SetValueInvocationException
    + FullyQualifiedErrorId : ExceptionWhenSetting
    + PSComputerName        : Contoso-DEVSP

よろしくお願いします

4

1 に答える 1

0

CredSSP 認証を確認する必要があります。2 番目のホップが資格情報をシステム資格情報に変換するため、SharePoint でのリモート PowerShell の実行は失敗します。タスクに DB サーバーのクエリまたは更新が含まれる場合、SYSTEM アカウントは SQL Server 上のリモート PowerShell にアクセスできないため、タスクは失敗します。CredSSP を有効にする必要があります。

少し前に書いたこのブログ記事を確認してください。これは SharePoint に固有のものではありませんが、シナリオにも当てはまるはずです。

http://www.ravichaganti.com/blog/?p=1230

于 2013-06-27T06:40:17.367 に答える