Friday, 7 July 2023

PowerShell: How get all DHCP Server using PowerShell

 PowerShell: How get all DHCP Server using PowerShell



PowerShell: How get all DHCP Server using PowerShell

 

 

# Get all DHCP Server

$dhcpServers = Get-DhcpServerInDC

 

# Display the list of DHCP servers

foreach ($server in $dhcpServers) {

    Write-Host "DHCP Server: $($server.DnsName)"

}

 

 

Using Windows Command

 

netsh dhcp show server >> c:\temp\dhcpserver.txt



No comments:

Post a Comment