diff --git a/windows/changeIP.ps1 b/windows/changeIP.ps1 index b05e12e8b42ae4d6cd1e854f0c4138ee2b28f3cc..cd47a8ebc7a52882b90a9cde798d770be288ba6e 100644 --- a/windows/changeIP.ps1 +++ b/windows/changeIP.ps1 @@ -1,6 +1,14 @@ -# -# IP adressen Script mit anschließender MAC-Adressenausgabe -# +<# +.SYNOPSIS + Windows Ethernet IP Changer +.DESCRIPTION + Dieses Script ändert die IP Adresse von ausgewählter Ethernet Hardware und gibt die Infos in eine CSV Datei aus, welche ins DDI importiert werden kann. +.OUTPUTS + Die Datei "MACADRESS.csv" wird im selbigen Ordner ausgegeben wie das Script ausgeführt wird. +.NOTES + Author: Saad Chaaban + Creation Date: 12022-01-01 +#> # Behebt das Problem das die Datei komische Zeichen generiert $PSStyle.OutputRendering = 'Host' @@ -41,7 +49,8 @@ switch (Read-Host "Auswahl eingeben und mit Enter bestätigen"){ Set-DnsClientServerAddress -InterfaceIndex $Interface.ifIndex -ServerAddresses 141.20.2.3,141.20.1.3 $ipadress = Get-NetIPAddress | select ifIndex, IPV4Address | Where-Object { ( $_.ifIndex -eq $Interface.ifIndex ) -and ( $_.IPV4Address -match '141' )} - $export = @( [pscustomobject]@{Name=[System.Net.Dns]::GetHostByName($env:computerName).hostname;Address=$ipadress.IPV4Address;MAC=$Interface.MacAddress;Hostname=[Net.Dns]::GetHostName();'Class param: hub_ip_comment'="CHANGE ME";'Class param: hub_workgroup'="CHANGE ME"} + $export = @( [pscustomobject]@{Name=[System.Net.Dns]::GetHostByName($env:computerName).hostname;Address=$ipadress.IPV4Address;MAC=$Interface.MacAddress;Hostname=[Net.Dns]::GetHostName();'Class param: hub_ip_comment +'="CHANGE ME";'Class param: hub_workgroup'="CHANGE ME"} ) $export $export | Export-Csv -Path $psscriptroot\MACADRESS.csv @@ -66,4 +75,4 @@ default {"Ungültige Eingabe"} } Write-Host -NoNewLine 'Press any key to continue...'; -$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown'); \ No newline at end of file +$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');