同じドメイン \tt-sql.perf.corp と \tt-file.perf.corp で Windows Server 2012 R2 を実行している 2 つのサーバーがあります。ファイル サーバーの共有フォルダー \tt-file.perf.corp\fileshare\helloworld.ps1 に Powershell スクリプトがあります。次のコマンドを実行するSQLサーバー上にアプリケーションがあります。
powershell -NonInteractive -InputFormat None -ExecutionPolicy Bypass -Command "& '\tt-file.perf.corp\fileshare\helloworld.ps1'"
次のエラーで失敗しています。
& : AuthorizationManager のチェックに失敗しました。行:1 文字:3 + & '\tt-file.perf.corp\fileshare\helloworld.ps1' + ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess
IP アドレスを使用するようにパスを変更した場合も失敗します。
ただし、スクリプトへのパスが完全修飾されていない場合に機能します。
powershell -NonInteractive -InputFormat None -ExecutionPolicy Bypass -Command "& '\tt-file\fileshare\helloworld.ps1'"
Windows Management Instrumentation サービスは両方のサーバーで実行されています。両方のサーバーでも Get-ExecutionPolicy を実行しましたが、どちらも無制限に設定されています。両方のサーバーで UAC が無効になっています。どうしたの?