DRRAM
asked on
DHCP script
I have DHCP on windows 2008 R2
Please I need a script that gives me as a result the name of scope and the START and END IP address of all scope in DHCP.
THX
Please I need a script that gives me as a result the name of scope and the START and END IP address of all scope in DHCP.
THX
ASKER
I search for example:
Scope Start IP Address End IP Address
site1 18.180.1.1 18.180.1.222
.....
......
Scope Start IP Address End IP Address
site1 18.180.1.1 18.180.1.222
.....
......
ASKER
I wait a response please
I search for example:
Scope Start IP Address End IP Address
site1 18.180.1.1 18.180.1.222
.....
......
I search for example:
Scope Start IP Address End IP Address
site1 18.180.1.1 18.180.1.222
.....
......
You could look at Microsoft's powershell module for DHCP. http://gallery.technet.microsoft.com/scriptcenter/05b1d766-25a6-45cd-a0f1-8741ff6c04ec
I would use netsh utility with dhcp context on DHCP server.
Log on to your 2008R2 DHCP server and in command-line type
netsh dhcp server dump >c:\dhcp.log
and open this file in notepad. Look for "Add Scope" section. There are all scopes and below them you will find IP ranges for them
Regards,
Krzysztof
Log on to your 2008R2 DHCP server and in command-line type
netsh dhcp server dump >c:\dhcp.log
and open this file in notepad. Look for "Add Scope" section. There are all scopes and below them you will find IP ranges for them
Regards,
Krzysztof
ASKER
I wait a response please
I search only the three fields below
Scope Start IP Address End IP Address
site1 18.180.1.1 18.180.1.222
.....
......
I search only the three fields below
Scope Start IP Address End IP Address
site1 18.180.1.1 18.180.1.222
.....
......
ASKER
??????
ASKER
???? I wait a solution
Take a look at this blog post. This should give you the information you are looking and uses netsh like iSiek suggested but powershell to parse the output.
http://theadminguy.wordpress.com/2010/04/15/export-dhcp-scopes-and-their-address-pools-to-a-csv-file/
http://theadminguy.wordpress.com/2010/04/15/export-dhcp-scopes-and-their-address-pools-to-a-csv-file/
ASKER
KenMcF
please
What can I change in the script so that I can export the full name of scope
because “Location” take the name of the scope with no spaces and not full name (except 13 characters)
I wait your response
thx
please
What can I change in the script so that I can export the full name of scope
because “Location” take the name of the scope with no spaces and not full name (except 13 characters)
I wait your response
thx
Can you post a few examples of your scope names? Do they have spaces and dashes "-" in them?
ASKER
KenMcF
For example I have in the DHCP
Scope name : AN/SITE 9 FSG-JOKSF_IJISD /SI .SG anglais
After running the script -> the result in the file. csv
15.122.1.0,"255.255.255.22 4","15.122 .1.20","15 .122.1.33" ,"AN/SITE9 FSG"
comparing :
AN/SITE 9 FSG-JOKSF_IJISD /SI .SG anglais
AN/SITE9FSG
Other example:
Scope name : BU/Tut_Yurto/Qour_Tu_Mexic /Terfgytu
After running the script -> the result in the file. csv
15.122.55.0,"255.255.255.1 28","15.12 2.55.62"," 15.122.55. 128","BU/T ut_Yurto/Q our_Tu_"
comparing :
BU/Tut_Yurto/Qour_Tu_Mexic /Terfgytu
BU/Tut_Yurto/Qour_Tu_
I wait your response
thx
For example I have in the DHCP
Scope name : AN/SITE 9 FSG-JOKSF_IJISD /SI .SG anglais
After running the script -> the result in the file. csv
15.122.1.0,"255.255.255.22
comparing :
AN/SITE 9 FSG-JOKSF_IJISD /SI .SG anglais
AN/SITE9FSG
Other example:
Scope name : BU/Tut_Yurto/Qour_Tu_Mexic
After running the script -> the result in the file. csv
15.122.55.0,"255.255.255.1
comparing :
BU/Tut_Yurto/Qour_Tu_Mexic
BU/Tut_Yurto/Qour_Tu_
I wait your response
thx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
KenMcF
please,
The only problem is: it does not give the full name of the scope
you will try if there is another way to get this information?
thx
please,
The only problem is: it does not give the full name of the scope
you will try if there is another way to get this information?
thx
ASKER
please,,,??
The only problem is: it does not give the full name of the scope
you will try if there is another way to get this information?
thx
The only problem is: it does not give the full name of the scope
you will try if there is another way to get this information?
thx
this looks to be a limitation of netsh. I have not been able to find another way to get this info. I will keep looking.
ASKER
Thanks and waiting for your kind reply as soon as possible
ASKER
?
ASKER
completly
http://powershell.com/cs/media/p/1714.aspx