mac address
This commit is contained in:
18
Scripts/powershell/MAC_Address_und_IP_change.ps1
Normal file
18
Scripts/powershell/MAC_Address_und_IP_change.ps1
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# 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 ""
|
||||||
Reference in New Issue
Block a user