Re: Netsh bat file to add scopes in dhcp when using a txt list of name
- From: v-robeli@xxxxxxxxxxxxxxxxxxxx (Robert Li [MSFT])
- Date: Tue, 13 Feb 2007 10:18:55 GMT
Hi
Thanks for posting in our newsgroup.
From your description, I know that you want to add scopes to DHCP with abat file. If I am off-base, please don't hesitate to let me know.
I am sorry that we don't provide technical support for bat file in this
newsgroup. Please open a new post in our microsoft. public.msdn newsgroup.
Thanks for understanding.
If you need further assistance, please don't hesitate to let me know.
Best regards,
Robert Li(MSFT)
Microsoft CSS Online Newsgroup Support
Get Secure! - www.microsoft.com/security
=====================================================
This newsgroup only focuses on SBS technical issues. If you have issues
regarding other Microsoft products, you'd better post in the corresponding
newsgroups so that they can be resolved in an efficient and timely manner.
You can locate the newsgroup here:
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx
When opening a new thread via the web interface, we recommend you check the
"Notify me of replies" box to receive e-mail notifications when there are
any updates in your thread. When responding to posts via your newsreader,
please "Reply to Group" so that others may learn and benefit from your
issue.
Microsoft engineers can only focus on one issue per thread. Although we
provide other information for your reference, we recommend you post
different incidents in different threads to keep the thread clean. In doing
so, it will ensure your issues are resolved in a timely manner.
For urgent issues, you may want to contact Microsoft CSS directly. Please
check http://support.microsoft.com for regional support phone numbers.
Any input or comments in this thread are highly appreciated.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
<From: "Steve" <newsgroup@xxxxxxxxxx>
<References: <4A0C8B1D-3DEF-460B-93CD-2080694CE5F4@xxxxxxxxxxxxx>
<Subject: Re: Netsh bat file to add scopes in dhcp when using a txt list of
name
<Date: Mon, 12 Feb 2007 21:40:37 -0800
<Lines: 65
<X-Priority: 3
<X-MSMail-Priority: Normal
<X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
<X-RFC2646: Format=Flowed; Original
<X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
<Message-ID: <O9wk#FzTHHA.1364@xxxxxxxxxxxxxxxxxxxx>
<Newsgroups: microsoft.public.windows.server.sbs
<NNTP-Posting-Host: pia140-174.pioneernet.net 66.114.140.174
<Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP06.phx.gbl
<Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.windows.server.sbs:16672
<X-Tomcat-NG: microsoft.public.windows.server.sbs
<
<Doesn't sound like this is on an SBS 2003 box?
<
<"acem77" <acem77@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
<news:4A0C8B1D-3DEF-460B-93CD-2080694CE5F4@xxxxxxxxxxxxxxxx
<> the proplem is i cant seem to find any info on how to use
<> a for /f loop to grab 2 sets of information. mainly i want to grab the
<> scopes IP 192.168.1 and the scope name from a premade txt file. while
<> using a
<> batch file
<> with all the commands to add 400+ scopes in to dhcp.
<>
<> i have 99% of everything working great. here is my batch file. i am sure
<> it
<> is ugly but it was my 1st real try at this to save some time.
<> this does everything right. but id like to grab data from the same txt
<> file
<> or another one with the needed scope names.
<> as you can see i now have it grab the ip addresses from a txt file.
<> if i try to combine 2 for /f loops i get some stuff but it is never
<> correct.
<>
<>
<>
<> set w=.1
<> set x=.0
<> set z=.100
<> set y=.254
<> set serverscope=serverscope.txt
<>
<> FOR /f "tokens=*" %%M in (%serverscope%) do CALL :CHECK "%%M"
<>
<> GOTO :EOF
<>
<> :CHECK
<> SET serverscope=%~1
<> SET serverscope=%serverscope: =%
<>
<> set dhcpserver=10.194.11.207
<> set ip=%serverscope%
<> set scope=%ip%%x%
<> set scopename=%name%
<> set description=%username%_02/12/07
<> set iprange_exclude=%ip%%z% %ip%%y%
<> set router=%ip%%w%
<> set subnet=255.255.255.0
<>
<> netsh dhcp server \\%dhcpserver% add scope %scope% %subnet% %scopename%
<> %description%
<> netsh dhcp server \\%dhcpserver% scope %scope% add iprange
<> %iprange_exclude%
<> netsh dhcp server \\%dhcpserver% scope %scope% add excluderange
<> %iprange_exclude%
<> netsh dhcp server \\%dhcpserver% scope %scope% set optionvalue 51 dword
<> 2592000
<> netsh dhcp server \\%dhcpserver% scope %scope% set optionvalue 003
<> ipaddress
<> %router%
<> netsh dhcp server \\%dhcpserver% scope %scope% set state 1
<>
<>
<>
<>
<>
<
<
<
.
- References:
- Prev by Date: Re: Partitioning Network
- Next by Date: RE: Server Disk Space
- Previous by thread: Re: Netsh bat file to add scopes in dhcp when using a txt list of name
- Next by thread: RE: SQL 2005 Connection Issue
- Index(es):
Relevant Pages
|