Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
问题是我需要能够在整个农场中搜索 .bak 文件使它更容易,而不是去单个服务器来做这件事我对 PowerShell 来说也是非常新的
这应该让你开始。它使用Invoke-Command,这需要打开 PowerShell 远程处理并在您的所有服务器上运行。
Invoke-Command
Invoke-Command -ComputerName server1,server2,server3 -Credential adminusername -ScriptBlock { Get-ChildItem -Path C:\SearchHere -Filter *.bak -Recurse }