Blueprint script to create DNS records in AD

Create this following code as a bat. You can than run the following (assuming you called the bat adddns.bat):
>adddns mynewhost01 0 10

This will create the records for a host (in the example)

@echo off
if "%1" == "" goto error
if "%2" == "" goto error
if "%3" == "" goto error

dnscmd abinbev.demo /recordadd yourdomain.com %1 A 192.168.%2.%3
dnscmd abinbev.demo /recordadd %2.168.192.in-addr.arpa %3 PTR %1.yourdomain.com

goto end

echo name
echo adddns.bat host1 2 213
goto end

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.