Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Get all DHCP server and scope information for a domain

$
0
0

I am after some assistance in creating a powershell script to run that will allow me to get all DHCP server and scope information.  Below is what I need the script to do. Thank you.

1) It will first run this command:

  a) Get-DhcpServerInDC (write the output to a file)

  • This will list all DHCP servers in the domain

2) I then need it to loop through each DHCP server in this list (1a) and run

  a) Get-DhcpServerv4Scope –ComputerName variable (write the output to a file)

  • This will list the scopes of each DHCP server

  b) Get-DhcpServerv4OptionValue–ComputerName variable (write the output to a file)

  • This will list the server options of each DHCP server

 

3) I then need it to loop through each DHCP server (1a) and each scope (2a) and run

  a) Get-DhcpServerv4OptionValue–ComputerName (1a variable)–ScopeID (2a variable) (write the output to a file)

  • This will list the scope options of each scope



Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>