Hello every body!
i made this program :
do{
$ServerName = Import-Csv -Path "C:\Desktop\importer0.csv"
$ping= new-object System.Net.NetworkInformation.Ping
$objExcel = new-object -comobject excel.application
$objExcel.visible = $false
$datex= get-date -format ddMMyyyy
$Path="C:\Users\mallee\Desktop\test_excel\ping_$datex.xlsx"
$repond=""
$repondpas=""
Foreach ($IP in $ServerName){
$IP0=((($IP.adresIP).substring(1,14)).replace('.0','.')).replace('.0','.') "
$reply=$ping.Send($IP0)
Try{
$Info=[System.Net.Dns]::GetHostentry($IP0)
$Name=$Info.HostName
$DATE=get-date
}
Catch{
$Name = "inconnu"
#Write-Host $_
$DATE=get-date
}
if ($reply.status –eq “Success”){
$reponse="repond"
$repond +=" $IP0 ;$Name ;$reponse ;$DATE ""`n"
}
else{
#$repondpas =""
#$repondpas=";"
$reponse="ne repond pas"
$repondpas += “$IP0 ;$Name...