Bu betiğe IP adresini eklemeye çalışıyorum, işe yarayabilseydim mükemmel olurdu. Herhangi bir yardım büyük beğeni topluyor. Giriş dosyaları ana bilgisayar adlarına sahiptir ve IP adresini csv'ye almak istiyorum lütfen.Test-Bağlantısı kullanılırken IP adresi alma
$servers = Get-content "servers.txt"
$collection = $()
foreach ($server in $servers)
{
$status = @{ "ServerName" = $server; "TimeStamp" = (Get-Date -f s);"IP" = what to put here? }
if (Test-Connection $server -Count 1 -ea 0 -Quiet)
{
$status["Results"] = "Up"
}
else
{
$status["Results"] = "Down"
}
New-Object -TypeName PSObject -Property $status -OutVariable serverStatus
$collection += $serverStatus
}
$collection | Export-Csv -LiteralPath .\ServerStatus.csv -NoTypeInformation
fazla ilgi olabileceğini yaptıysanız 'Sunucularınız yeni IP yapılandırması bölümüne geçtikten eğer çok çalışır .IPAddressToString' ($ result.IPV6Address) :) – krousemw
TEŞEKKÜRLER !!!! Bu harika çalıştı. – Steve
Başarısız olanlara bir NSLOOKUP ekleyebilir miyim? – Steve