All pastes #36rhJYRMhd Raw Edit

text paste

public text v1 · immutable
·published 2026-10-28 14:51 UTC
rendered paste body
# Henter alle aktive leases direkte fra Windows DHCP databasen via CIMGet-CimInstance -Namespace root\Microsoft\Windows\DHCP -ClassName PS_DhcpServerv4Lease -ComputerName localhost |     Where-Object { $_.AddressState -ne 3 } | # 3 = Inactive/Declined    Select-Object HostName, IPAddress, ClientId, ScopeId |     Export-Csv -Path "C:\temp\dhcp_leases.csv" -NoTypeInformation -Encoding UTF8Write-Host "Eksport fullført!" -ForegroundColor Green