Import-Module PoshWSUS Connect-PoshWSUSServer -WsusServer cnhzsrv09 Get-PoshWSUSClient | Select-Object -Property IPAddress, FullDomainName | Export-Csv -Path C:aaa.csv -Force $ip = Read-Host -Prompt "请输入IP地址" Import-Csv -Path c:aaa.csv | ForEach-Object { if($ip -eq $_.ipaddress) { Enter-PSSession -ComputerName $_.fulldomainname } }