docs: create powershell/export-reservations-dhcp

This commit is contained in:
Nicolas Simond
2023-08-10 12:00:47 +00:00
committed by stylersnico
parent 53c1b661d2
commit 6a2429b410
+24
View File
@@ -0,0 +1,24 @@
---
title: Export des réservations DHCP de WIndows Serveur
description: Export des réservations DHCP de Wnndows Serveur en Powershell
published: true
date: 2023-08-10T12:00:43.919Z
tags: powershell, dhcp
editor: markdown
dateCreated: 2023-08-10T12:00:43.919Z
---
# Introduction
Le but de ce script est de récupérer les réservations DHCP au format CSV.
# Script
```powershell
Get-DHCPServerV4Scope | ForEach {
Get-DHCPServerv4Lease -ScopeID $_.ScopeID | where {$_.AddressState -like '*Reservation'}
} | Select-Object HostName,ClientID,AddressState | Export-Csv ".\$($env:COMPUTERNAME)-Reservations.csv" -NoTypeInformation
```