Files
WPanda/Scripts/powershell/MAC_Address_und_IP_change.ps1
2026-03-03 14:08:56 +01:00

18 lines
748 B
PowerShell
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 1⃣ A hálókártya neve (adapter) lekérése
$adapter = Get-NetAdapter | Where-Object {$_.Status -eq "Up" -and $_.InterfaceDescription -like "*Ethernet*"}
# 2⃣ Ideiglenes MAC-cím generálása (pl. véletlen)
$newMac = -join ((65..70) + (0..9) | Get-Random -Count 12 | ForEach-Object {[char]$_})
Write-Host "Új ideiglenes MAC: $newMac"
# 3⃣ MAC-cím módosítása
Set-NetAdapterAdvancedProperty -Name $adapter.Name -DisplayName "Network Address" -DisplayValue $newMac
# 4⃣ DHCP bérlet frissítése
# Release
ipconfig /release
# Renew
ipconfig /renew
# 5⃣ Visszaállítás a régi MAC-re (opcionális, ha szeretnéd)
Set-NetAdapterAdvancedProperty -Name $adapter.Name -DisplayName "Network Address" -DisplayValue ""