bonjour
je cherche à finaliser un script pour :
test compte ftp (ftp ou sftp) et redémarrer le service si il n'est pas disponible ( envoi de mail si non joignable )
merci pour l'aide
voici le début
Code PowerShell : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #$TestNetConnection = Test-NetConnection ftp.altavia-group.com -Port 21 $ServiceName = 'Serv-U' $arrService = Get-Service -Name $ServiceName # while ($TestNetConnection.TcpTestSucceeded -ne 'True') # { # echo 'Test connection failed' while ($arrService.Status -ne 'Running') { Start-Service $ServiceName write-host $arrService.status write-host 'Service starting' Start-Sleep -seconds 60 } # $TestNetConnection = Test-NetConnection ftp.altavia-group.com -Port 21 # }
Partager