This commit is contained in:
2023-07-04 12:59:44 +02:00
parent 2cef42a718
commit 09c2faad93
231 changed files with 261001 additions and 4 deletions

19
Réseau/Ping.ps1 Normal file
View File

@ -0,0 +1,19 @@
#Fonctionne avec PowerShell 7
#Ping d'un plage d'IP de 192.168.1.1 à 192.168.1.254
1..254 | ForEach-Object -ThrottleLimit 50 -Parallel {
Test-Connection "192.168.1.$_" -Count 1 -TimeoutSeconds 2 -ErrorAction SilentlyContinue -ErrorVariable e
if ($e)
{
[PSCustomObject]@{ Destination = $_; Status = $e.Exception.Message }
}
} | Group-Object Destination | Select-Object Name, @{n = 'Status'; e = { $_.Group.Status } } | Where-Object Status -eq "Success" | Sort-Object { [system.version[]]($_.Name) }
#Ping à partir d'une liste d'IP dans un CSV
Import-Csv -path Ping.csv -Encoding UTF8 | ForEach-Object -ThrottleLimit 5 -Parallel {
Test-Connection $_.IP -Count 1 -TimeoutSeconds 2 -ErrorAction SilentlyContinue -ErrorVariable e
if ($e)
{
[PSCustomObject]@{ Destination = $_; Status = $e.Exception.Message }
}
} | Group-Object Destination | Select-Object Name, @{n = 'Status'; e = { $_.Group.Status } } | Sort-Object { [system.version[]]($_.Name) }

1
Réseau/README.md Normal file
View File

@ -0,0 +1 @@
# Réseau

View File

@ -0,0 +1,4 @@
Name, IP
Client 1, 1.1.1.1
Client 2, 8.8.8.8
Client 3, 8.8.4.4
1 Name IP
2 Client 1 1.1.1.1
3 Client 2 8.8.8.8
4 Client 3 8.8.4.4