Powershell scripting ile işi hızlandirip birden fazla domainin hangi IP’yi cozdugunu ve ping’e cevap verip vermedigini tespit edebiliriz.
Kısaca Powershell Nedir?
Microsoft’un .Net Framework destekli gelistirdigi en kapsamlı shell konsoludur. Powershell uzerinde .net tabanlı scripting calistirma imkanı bulabiliyorsunuz.
$readfile=get-content “C:\Users\root\Desktop\servers.txt“
foreach($readf in $readfile)
{
$ALive=get-wmiobject win32_pingstatus -Filter “Address=’$readf’” | Select-Object statuscode
if($ALive.statuscode -eq 0)
{write-host $readf is REACHABLE -background “GREEN” -foreground “BLACk”}
else
{
write-host $readf is NOT reachable -background “RED” -foreground “BLACk”}
}
Domain listesinin path’ini belirmeniz ve Powershell konsolu açıp yukaridaki kodlari calıştımanız gerekcektir.
Ping’e cevap veren domainler REACHABLE , pinge cevap vermeyen domainler ise NOT REACHABLE şeklinde konsola yansıyacaktır.
Detaylar:
http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx
http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx
Share on Facebook


