戻るWindows 7にPowershellの下位バージョンを使用した場合、次のコードは問題なく動作します。Get-ServiceのPowershellエラー
テキストファイルの各サーバーでサービスがいくつかチェックされ、結果がCSVにダンプされます。
今、私は、Windows 10上だとPowerShellを使用し、私はこのエラーメッセージを取得v5のこと:ここで
Get-Service : Cannot open Service Control Manager on computer 'tfsserver1'. This operation might require other privileges. At C:\Users\Razon\Desktop\Patching\ServerServices_Checker_v2.ps1:48 char:4 + (Get-Service -Name TFSJobAgent*,IIS*,World* -ComputerName $_) | Select Machine ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-Service], InvalidOperationException + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.GetServiceCommand
####System Varialbe to User's Deskotp
$filePath = [Environment]::GetFolderPath("Desktop")
コードは次のとおりです。
リモートサーバーでPSRemotingが有効になっていますか? TrustedHostsに追加しましたか? –