{"id":"36rhJYRMhd","url":"https://pastebin.ca/36rhJYRMhd","raw_url":"https://raw.anybin.ca/36rhJYRMhd","visibility":"public","access":"public","created_at":1793199063369,"expires_at":1793803863369,"fetch_limit":null,"fetches_used":0,"reads_remaining":null,"size_bytes":450,"syntax_hint":null,"title":null,"filename":null,"change_note":null,"cipher":null,"cipher_meta":null,"parent_id":null,"root_id":"36rhJYRMhd","version":1,"owner_id":null,"recipient_id":null,"body":"# Henter alle aktive leases direkte fra Windows DHCP databasen via CIM\nGet-CimInstance -Namespace root\\Microsoft\\Windows\\DHCP -ClassName PS_DhcpServerv4Lease -ComputerName localhost | \n    Where-Object { $_.AddressState -ne 3 } | # 3 = Inactive/Declined\n    Select-Object HostName, IPAddress, ClientId, ScopeId | \n    Export-Csv -Path \"C:\\temp\\dhcp_leases.csv\" -NoTypeInformation -Encoding UTF8\n\nWrite-Host \"Eksport fullført!\" -ForegroundColor Green"}